{"_id":"5bc6b0f8275af80056521971","project":"55e67aaa9cc7c62b00c4a1ea","version":{"_id":"5b720760c44b7600034b7a08","project":"55e67aaa9cc7c62b00c4a1ea","__v":0,"forked_from":"5b1f2cbdfd653400031d8d9f","createdAt":"2015-09-02T04:27:23.612Z","releaseDate":"2015-09-02T04:27:23.612Z","categories":["5b720760c44b7600034b79a7","5b720760c44b7600034b79a8","5b720760c44b7600034b79a9","5b720760c44b7600034b79aa","5b720760c44b7600034b79ab","561c61b4ad272c0d00a892df","586c014c0abf1d0f000d04d4","58991d2ad207df0f0002186b","5b720760c44b7600034b79ac","5b720760c44b7600034b79ad","5af0fe494ca2730003cbc98a","5af0fe55ec80af0003804ca2"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"API V6","version_clean":"1.4.0","version":"1.4"},"category":{"_id":"5b720760c44b7600034b79a9","__v":20,"pages":["5b720760c44b7600034b79c0","55ed079b0d968e2100de8339","5b720760c44b7600034b79c1","55ed0bb078319821005005cf","5b720760c44b7600034b79c2","5b720760c44b7600034b79c3","5b720760c44b7600034b79c4","5b720760c44b7600034b79c5","5b720760c44b7600034b79c6","5b720760c44b7600034b79c7","5b720760c44b7600034b79c8","5b720760c44b7600034b79c9","5b720760c44b7600034b79ca","5b720760c44b7600034b79cb","5b720760c44b7600034b79cc","5b720760c44b7600034b79cd","5b720760c44b7600034b79ce","5b720760c44b7600034b79d6","5b720760c44b7600034b79d7","5b720760c44b7600034b79df"],"project":"55e67aaa9cc7c62b00c4a1ea","version":"5b720760c44b7600034b7a08","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-09-02T04:30:21.948Z","from_sync":false,"order":5,"slug":"rest-api","title":"REST API"},"user":"58c7437515c5a22500e19012","__v":17,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-10-17T03:48:08.702Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"name":"","code":"{\n  \"id\" : \"5acfa75174bff800012754f0\",\n  \"results\": {\n    \"success\": 1,\n    \"uninstalled\": 2,\n    \"failures\": [\"5acaa58fa96e5d1a6c3716a3\"]\n  }\n}","language":"json","status":200}]},"settings":"","examples":{"codes":[{"language":"curl","code":"curl -X POST -u :API_KEY -H \"Content-type: application/json\" -H 'Accept: application/json' https://api.carnivalmobile.com/v6/transactional/notifications -d '{\n  \"to\": { \"field\": \"user_id\", \"value\": \"john_doe\" },\n  \"group\" : \"coupon-codes\",\n  \"notification\" : {\n    \"payload\": {\n      \"alert\" : \"Here is your coupon code: 12AF6CZ 🤑!\",\n      \"badge\" : 1\n    }\n  }\n}'"},{"code":"curl -X POST -u :API_KEY -H \"Content-type: application/json\" -H 'Accept: application/json' https://api.carnivalmobile.com/v6/transactional/notifications -d '{\n  \"to\": { \"field\": \"user_id\", \"value\": \"john_doe\" },\n  \"group\" : \"coupon-codes\",\n  \"notification\" : {\n    \"payload\": {\n      \"alert\": \"Check out this rich push!\",\n      \"badge\": 1,\n      \"sound\": \"Default.caf\",\n      \"category\": \"TEST_CATEGORY\",\n      \"mutable_content\": true,\n      \"_st\": {\n        \"image_url\": \"https://www.mysite.com/img.png\"\n      }\n    }\n  }\n}'","language":"curl","name":"Rich Push"}]},"method":"post","auth":"required","params":[{"_id":"5bc803d345671b001d145f42","ref":"","in":"body","required":true,"desc":"","default":"","type":"object","name":"to"},{"_id":"5bc803d345671b001d145f41","ref":"","in":"body","required":true,"desc":"","default":"","type":"string","name":"group"},{"_id":"5bc803d345671b001d145f40","ref":"","in":"body","required":true,"desc":"","default":"","type":"object","name":"notification"}],"url":"/transactional/notifications"},"isReference":true,"order":2,"body":"## Payload Field\n\nPlease refer to [Notifications Payload Field](https://docs.carnival.io/docs/notifications#section-payload-field) section.\n\n## To Field\n\nThere are three possible fields that can be used as targets:\n\n- `device_id` (Unique identification of a device)\n- `user_id`\n- `sid` (Sailthru Profile ID)\n\n\n## Group\n\nPushes will be grouped by a group identifier. Group identifiers must have at least 3 characters and at most 64 characters. Group identifiers can't include special characters other than hyphens (`-`)\n\nExamples:\n\n- `promotion-2018-March`\n- `delivery`\n- `SALES`\n\n## Payload\n\nThe notification payload accepts:\n\n- `alert`, `title` and `subtitle` to compose the message text\n- `badge` which must be a non negative number\n- `collapse_key` which causes push notifications to merge if another push has the same key. Its length must not be greater than 64 characters.\n- `mutable_content`, `content_available`, `category` special keys\n- Any other custom key will be sent untouched as part of the payload\n\n\n    {\n      \"to\": { \"field\": \"user_id\", \"value\": \"john_doe\" },\n      \"group\" : \"coupon_codes\",\n      \"payload\": {\n        \"alert\" : \"Here is your coupon code: 12AF6CZ 🤑!\",\n        \"title\" : \"Coupon for you\",\n        \"subtitle\" : \"Grab your code here\",\n        \"collapse_key\" : \"coupon-message\",\n        \"coupon_code\" : \"12AF6CZ\"\n        \"badge\" : 100\n      }\n    }\n\n## Response\n\n    {\n      \"id\" : \"5acfa75174bff800012754f0\",\n      \"results\": {\n        \"success\": 1,\n        \"uninstalled\": 2,\n        \"failures\": [\"5acaa58fa96e5d1a6c3716a3\"]\n       }\n    }\n\nResults will include:\n\n- Number of successful devices that the gateway considered successfully sent;\n- Number of devices that got detected by the gateway as uninstalled;\n- Device IDs that failed to receive the push. The user must retry using `to` as:\n\n```\n{ \"field\": \"device_id\", \"value\": \"5acaa58fa96e5d1a6c3716a3\" }\n```\n\nFor each `device_id` returned on `failures`.\n\nThe results are the gateway perspective (APNs & Firebase) about the push.\n\n## Restrictions\nLiquid is not yet supported for this endpoint.\n\nThe follow keys should **not** be used:\n\n- `from`\n- `google`\n- `gcm`","excerpt":"","slug":"transactional-notifications","type":"endpoint","title":"Transactional Notifications"}

postTransactional Notifications


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

to:
required
object
group:
required
string
notification:
required
object

Examples


Result Format


Documentation

## Payload Field Please refer to [Notifications Payload Field](https://docs.carnival.io/docs/notifications#section-payload-field) section. ## To Field There are three possible fields that can be used as targets: - `device_id` (Unique identification of a device) - `user_id` - `sid` (Sailthru Profile ID) ## Group Pushes will be grouped by a group identifier. Group identifiers must have at least 3 characters and at most 64 characters. Group identifiers can't include special characters other than hyphens (`-`) Examples: - `promotion-2018-March` - `delivery` - `SALES` ## Payload The notification payload accepts: - `alert`, `title` and `subtitle` to compose the message text - `badge` which must be a non negative number - `collapse_key` which causes push notifications to merge if another push has the same key. Its length must not be greater than 64 characters. - `mutable_content`, `content_available`, `category` special keys - Any other custom key will be sent untouched as part of the payload { "to": { "field": "user_id", "value": "john_doe" }, "group" : "coupon_codes", "payload": { "alert" : "Here is your coupon code: 12AF6CZ 🤑!", "title" : "Coupon for you", "subtitle" : "Grab your code here", "collapse_key" : "coupon-message", "coupon_code" : "12AF6CZ" "badge" : 100 } } ## Response { "id" : "5acfa75174bff800012754f0", "results": { "success": 1, "uninstalled": 2, "failures": ["5acaa58fa96e5d1a6c3716a3"] } } Results will include: - Number of successful devices that the gateway considered successfully sent; - Number of devices that got detected by the gateway as uninstalled; - Device IDs that failed to receive the push. The user must retry using `to` as: ``` { "field": "device_id", "value": "5acaa58fa96e5d1a6c3716a3" } ``` For each `device_id` returned on `failures`. The results are the gateway perspective (APNs & Firebase) about the push. ## Restrictions Liquid is not yet supported for this endpoint. The follow keys should **not** be used: - `from` - `google` - `gcm`

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}