{"_id":"5767b25ca151c10e0043156a","category":"5767b1ecd88bc90e00c88cd4","order":0,"slug":"getting-started","updates":[],"title":"Management API Documentation","type":"basic","githubsync":"","hidden":false,"isReference":false,"sync_unique":"","api":{"url":"/sdf","auth":"required","examples":{"codes":[]},"params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":""},"createdAt":"2016-06-20T09:07:40.106Z","link_external":false,"parentDoc":null,"project":"5626303ed0f87e190014c548","user":"56262ffad0f87e190014c547","version":"5626303fd0f87e190014c54b","__v":18,"body":"The Management API exposes various services to enable your servers or any third-party application to interact with WonderPush, to make your applications more successful by leveraging the power of notifications. It enables you to perform administrative tasks and manage your applications, users, installations, push campaigns... Basically all that can be done via your web dashboard can be done using these APIs.\n\nYou will only need two things to get started:\n\n1. Your credentials that are located on WonderPush dashboard under *Settings > Configuration > Management API*.\n  Take note of the *access token*.\n\n2. Some tool to perform HTTP calls:\n  * *(Simplest)* Use the API Explorer on this page!\n  * *(Geeks will love)* Use [our python command-line client](https://github.com/wonderpush/wonderpush-python-lib).\n  * *(Classic)* A linux console, with the `curl` utility installed.\n  * *(Accessible)* Use a handy browser extension. Try [Advanced REST client](https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo) for Chrome, [REST Easy](https://addons.mozilla.org/fr/firefox/addon/rest-easy/) for Firefox.\n  * *(Harder to setup)* A windows console, with `curl` [manually installed](https://curl.haxx.se/download.html#Win64). You will need to adapt the quoting of the proposed examples.\n  * *(You name it!)* As long as you can perform a POST call to our HTTPS API, you're covered.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Examples\"\n}\n[/block]\nCode samples are displayed on the right column.\nHere is an example call to a phony end-point. to serve as a basis:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -XPOST https://api.wonderpush.com/v1/management/SOME-ENDPOINT \\\\\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN\\n    -d someExampleObjectParam='{\\\"json\\\":\\\"properly formatted, UTF-8 encoded and escaped\\\"}'\",\n      \"language\": \"curl\"\n    },\n    {\n      \"code\": \"<?php\\n\\n$ch = curl_init();\\n\\ncurl_setopt($ch, CURLOPT_URL, \\\"https://api.wonderpush.com/v1/management/SOME-ENDPOINT\\\");\\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\\ncurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array(\\n    'accessToken' => \\\"YOUR_APPLICATION_ACCESS_TOKEN\\\",\\n    'someExampleObjectParam' => json_encode([\\\"json\\\" => \\\"properly formatted, UTF-8 encoded and escaped\\\"]),\\n)));\\n\\n$rawResponse = curl_exec($ch);\\n\\nif (curl_errno($ch)) {\\n\\n    echo 'Error: ' . curl_error($ch);\\n\\n} else {\\n\\n    $response = json_decode($rawResponse, true);\\n    if (isset($response['success']) && $response['success'] === true) {\\n        echo 'Success';\\n    } else if (isset($response['error']['status'])\\n               && isset($response['error']['code'])\\n               && isset($response['error']['message'])) {\\n        echo 'Error ' . $response['error']['status']\\n          . ' code ' . $response['error']['code']\\n          . ': ' . $response['error']['message'];\\n    } else {\\n        echo 'Error: ' . $rawResponse;\\n    }\\n\\n}\\n\\ncurl_close($ch);\\n\\n?>\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Dates and times\"\n}\n[/block]\nWonderPush exclusively uses UNIX timestamps (seconds elapsed since January 1st 1970) in milliseconds, and expresses textual dates and times in UTC, always specifying the used timezone to avoid confusion.\nYou can also use a textual representation of a date using the following ISO8601 format: `YYYY[-MM[-DD]][THH[:MM[:SS[.SSS]]]][Z|+HH[:MM[:SS[.SSS]]]]`\nHere are valid examples: `2015`, `2015-12`, `2015-12-31`, `2015-12-31T23`, `2015-12-31T23:59`, `2015-12-31T23:59:59`, `2015-12-31T23:59:59.999`.\nHere are valid offsets you can also append: `Z` for UTC, `-06`, `+02:00`. In the absence of an offset, the date is taken as UTC.\nUnless explicitly mentioned, any missing part is taken as January 1st for date-part and midnight for the time-part.\n\nAny field or parameter that ends with `Date` expects a UNIX timestamp in millisecond, or ISO8601 formatted string.\nAny field or parameter that ends with `Time` expects a duration expressed in milliseconds.","excerpt":"A few things before we start.","link_url":"","next":{"description":"","pages":[]},"childrenPages":[]}

Management API Documentation

A few things before we start.

The Management API exposes various services to enable your servers or any third-party application to interact with WonderPush, to make your applications more successful by leveraging the power of notifications. It enables you to perform administrative tasks and manage your applications, users, installations, push campaigns... Basically all that can be done via your web dashboard can be done using these APIs. You will only need two things to get started: 1. Your credentials that are located on WonderPush dashboard under *Settings > Configuration > Management API*. Take note of the *access token*. 2. Some tool to perform HTTP calls: * *(Simplest)* Use the API Explorer on this page! * *(Geeks will love)* Use [our python command-line client](https://github.com/wonderpush/wonderpush-python-lib). * *(Classic)* A linux console, with the `curl` utility installed. * *(Accessible)* Use a handy browser extension. Try [Advanced REST client](https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo) for Chrome, [REST Easy](https://addons.mozilla.org/fr/firefox/addon/rest-easy/) for Firefox. * *(Harder to setup)* A windows console, with `curl` [manually installed](https://curl.haxx.se/download.html#Win64). You will need to adapt the quoting of the proposed examples. * *(You name it!)* As long as you can perform a POST call to our HTTPS API, you're covered. [block:api-header] { "type": "basic", "title": "Examples" } [/block] Code samples are displayed on the right column. Here is an example call to a phony end-point. to serve as a basis: [block:code] { "codes": [ { "code": "curl -XPOST https://api.wonderpush.com/v1/management/SOME-ENDPOINT \\\n -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN\n -d someExampleObjectParam='{\"json\":\"properly formatted, UTF-8 encoded and escaped\"}'", "language": "curl" }, { "code": "<?php\n\n$ch = curl_init();\n\ncurl_setopt($ch, CURLOPT_URL, \"https://api.wonderpush.com/v1/management/SOME-ENDPOINT\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array(\n 'accessToken' => \"YOUR_APPLICATION_ACCESS_TOKEN\",\n 'someExampleObjectParam' => json_encode([\"json\" => \"properly formatted, UTF-8 encoded and escaped\"]),\n)));\n\n$rawResponse = curl_exec($ch);\n\nif (curl_errno($ch)) {\n\n echo 'Error: ' . curl_error($ch);\n\n} else {\n\n $response = json_decode($rawResponse, true);\n if (isset($response['success']) && $response['success'] === true) {\n echo 'Success';\n } else if (isset($response['error']['status'])\n && isset($response['error']['code'])\n && isset($response['error']['message'])) {\n echo 'Error ' . $response['error']['status']\n . ' code ' . $response['error']['code']\n . ': ' . $response['error']['message'];\n } else {\n echo 'Error: ' . $rawResponse;\n }\n\n}\n\ncurl_close($ch);\n\n?>", "language": "php" } ] } [/block] [block:api-header] { "type": "basic", "title": "Dates and times" } [/block] WonderPush exclusively uses UNIX timestamps (seconds elapsed since January 1st 1970) in milliseconds, and expresses textual dates and times in UTC, always specifying the used timezone to avoid confusion. You can also use a textual representation of a date using the following ISO8601 format: `YYYY[-MM[-DD]][THH[:MM[:SS[.SSS]]]][Z|+HH[:MM[:SS[.SSS]]]]` Here are valid examples: `2015`, `2015-12`, `2015-12-31`, `2015-12-31T23`, `2015-12-31T23:59`, `2015-12-31T23:59:59`, `2015-12-31T23:59:59.999`. Here are valid offsets you can also append: `Z` for UTC, `-06`, `+02:00`. In the absence of an offset, the date is taken as UTC. Unless explicitly mentioned, any missing part is taken as January 1st for date-part and midnight for the time-part. Any field or parameter that ends with `Date` expects a UNIX timestamp in millisecond, or ISO8601 formatted string. Any field or parameter that ends with `Time` expects a duration expressed in milliseconds.
The Management API exposes various services to enable your servers or any third-party application to interact with WonderPush, to make your applications more successful by leveraging the power of notifications. It enables you to perform administrative tasks and manage your applications, users, installations, push campaigns... Basically all that can be done via your web dashboard can be done using these APIs. You will only need two things to get started: 1. Your credentials that are located on WonderPush dashboard under *Settings > Configuration > Management API*. Take note of the *access token*. 2. Some tool to perform HTTP calls: * *(Simplest)* Use the API Explorer on this page! * *(Geeks will love)* Use [our python command-line client](https://github.com/wonderpush/wonderpush-python-lib). * *(Classic)* A linux console, with the `curl` utility installed. * *(Accessible)* Use a handy browser extension. Try [Advanced REST client](https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo) for Chrome, [REST Easy](https://addons.mozilla.org/fr/firefox/addon/rest-easy/) for Firefox. * *(Harder to setup)* A windows console, with `curl` [manually installed](https://curl.haxx.se/download.html#Win64). You will need to adapt the quoting of the proposed examples. * *(You name it!)* As long as you can perform a POST call to our HTTPS API, you're covered. [block:api-header] { "type": "basic", "title": "Examples" } [/block] Code samples are displayed on the right column. Here is an example call to a phony end-point. to serve as a basis: [block:code] { "codes": [ { "code": "curl -XPOST https://api.wonderpush.com/v1/management/SOME-ENDPOINT \\\n -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN\n -d someExampleObjectParam='{\"json\":\"properly formatted, UTF-8 encoded and escaped\"}'", "language": "curl" }, { "code": "<?php\n\n$ch = curl_init();\n\ncurl_setopt($ch, CURLOPT_URL, \"https://api.wonderpush.com/v1/management/SOME-ENDPOINT\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array(\n 'accessToken' => \"YOUR_APPLICATION_ACCESS_TOKEN\",\n 'someExampleObjectParam' => json_encode([\"json\" => \"properly formatted, UTF-8 encoded and escaped\"]),\n)));\n\n$rawResponse = curl_exec($ch);\n\nif (curl_errno($ch)) {\n\n echo 'Error: ' . curl_error($ch);\n\n} else {\n\n $response = json_decode($rawResponse, true);\n if (isset($response['success']) && $response['success'] === true) {\n echo 'Success';\n } else if (isset($response['error']['status'])\n && isset($response['error']['code'])\n && isset($response['error']['message'])) {\n echo 'Error ' . $response['error']['status']\n . ' code ' . $response['error']['code']\n . ': ' . $response['error']['message'];\n } else {\n echo 'Error: ' . $rawResponse;\n }\n\n}\n\ncurl_close($ch);\n\n?>", "language": "php" } ] } [/block] [block:api-header] { "type": "basic", "title": "Dates and times" } [/block] WonderPush exclusively uses UNIX timestamps (seconds elapsed since January 1st 1970) in milliseconds, and expresses textual dates and times in UTC, always specifying the used timezone to avoid confusion. You can also use a textual representation of a date using the following ISO8601 format: `YYYY[-MM[-DD]][THH[:MM[:SS[.SSS]]]][Z|+HH[:MM[:SS[.SSS]]]]` Here are valid examples: `2015`, `2015-12`, `2015-12-31`, `2015-12-31T23`, `2015-12-31T23:59`, `2015-12-31T23:59:59`, `2015-12-31T23:59:59.999`. Here are valid offsets you can also append: `Z` for UTC, `-06`, `+02:00`. In the absence of an offset, the date is taken as UTC. Unless explicitly mentioned, any missing part is taken as January 1st for date-part and midnight for the time-part. Any field or parameter that ends with `Date` expects a UNIX timestamp in millisecond, or ISO8601 formatted string. Any field or parameter that ends with `Time` expects a duration expressed in milliseconds.
{"_id":"5763d8a8e3e44d0e000a4d66","link_url":"","slug":"broadcast-a-simple-notification","user":"56262ffad0f87e190014c547","version":"5626303fd0f87e190014c54b","body":"This will broadcast a simple notification to all users.","api":{"auth":"required","examples":{"codes":[{"code":"curl -XPOST https://api.wonderpush.com/v1/management/deliveries \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d targetSegmentIds=@ALL \\\n    -d notification='{\"alert\":{\"text\":\"Hello, WonderPush!\"}}'","language":"curl"}]},"method":"post","params":[{"ref":"","required":true,"type":"string","in":"body","_id":"5763d8a8e3e44d0e000a4d68","default":"@ALL","desc":"The target segmentIds, comma separated.","name":"targetSegmentIds"},{"_id":"5763d8a8e3e44d0e000a4d67","default":"Hello, WonderPush!","desc":"Look at the notification object reference for more information.","in":"body","name":"notification.alert.text","ref":"","required":true,"type":"string"}],"results":{"codes":[{"status":202,"language":"json","code":"{\"success\":true}","name":""},{"status":400,"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing notification, check either fields [campaignId, notificationId, notification]\"\n    }\n}","name":""}]},"settings":"","url":"/deliveries"},"category":"5767e9a1dcda2e0e00ce3361","title":"Simple broadcast","githubsync":"","isReference":true,"link_external":false,"order":0,"parentDoc":null,"type":"post","updates":[],"__v":0,"editedParams":true,"editedParams2":true,"excerpt":"Broadcast a simple notification to all users.","hidden":false,"project":"5626303ed0f87e190014c548","sync_unique":"","createdAt":"2016-06-17T11:02:00.960Z","childrenPages":[]}

postSimple broadcast

Broadcast a simple notification to all users.

Body Params

targetSegmentIds:
required
string@ALL
The target segmentIds, comma separated.
notification.alert.text:
required
stringHello, WonderPush!
Look at the notification object reference for more information.
This will broadcast a simple notification to all users.

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 }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



This will broadcast a simple notification to all users.
{"_id":"5767ae1cbb15f40e00a2873f","link_url":"","order":1,"project":"5626303ed0f87e190014c548","updates":[],"version":"5626303fd0f87e190014c54b","category":"5767e9a1dcda2e0e00ce3361","githubsync":"","isReference":true,"__v":1,"excerpt":"Point your users to the right screen.","type":"post","slug":"add-a-deeplink","user":"56262ffad0f87e190014c547","link_external":false,"parentDoc":null,"editedParams":true,"editedParams2":true,"hidden":false,"sync_unique":"","title":"Add a deeplink","api":{"params":[{"type":"string","name":"targetSegmentIds","_id":"5767ae1cbb15f40e00a28741","ref":"","in":"body","required":true,"desc":"","default":"@ALL"},{"desc":"The notification text.","default":"Hello, deeplink!","type":"string","name":"notification.alert.text","_id":"57baf0176436180e006ea3dc","ref":"","in":"body","required":true},{"name":"notification.alert.targetUrl","_id":"57baf0176436180e006ea3db","ref":"","in":"body","required":true,"desc":"Specify the desired screen or page URL to show when the user clicks the notification.","default":"http://www.yourwebsite.com/somePage?param=value","type":"string"}],"results":{"codes":[{"name":"","status":202,"language":"json","code":"{\"success\":true}"},{"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing notification, check either fields [campaignId, notificationId, notification]\"\n    }\n}","name":"","status":400}]},"settings":"","url":"/deliveries","auth":"required","examples":{"codes":[{"language":"curl","code":"curl -XPOST https://api.wonderpush.com/v1/management/deliveries \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d targetSegmentIds=@ALL \\\n    -d notification='{\n    \t\t\"alert\": {\n        \t\t\"text\": \"Hello, deeplink!\",\n            \"targetUrl\": \"http://www.yourwebsite.com/somePage?param=value\"\n        }\n    }'"}]},"method":"post"},"body":"Adding a deeplink is as simple as filling the `targetUrl` field of the notification's alert.\nFor Web users, you should use an `http://` or `https://` URL.\nFor iOS devices, you should use a URL starting with one of your registered URLs, like `yourapp://`.\nFor Android devices, it depends on what URLs you configured, either form is accepted.","createdAt":"2016-06-20T08:49:32.619Z","childrenPages":[]}

postAdd a deeplink

Point your users to the right screen.

Body Params

targetSegmentIds:
required
string@ALL
notification.alert.text:
required
stringHello, deeplink!
The notification text.
notification.alert.targetUrl:
required
stringhttp://www.yourwebsite.com/somePage?param=value
Specify the desired screen or page URL to show when the user clicks the notification.
Adding a deeplink is as simple as filling the `targetUrl` field of the notification's alert. For Web users, you should use an `http://` or `https://` URL. For iOS devices, you should use a URL starting with one of your registered URLs, like `yourapp://`. For Android devices, it depends on what URLs you configured, either form is accepted.

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 }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Adding a deeplink is as simple as filling the `targetUrl` field of the notification's alert. For Web users, you should use an `http://` or `https://` URL. For iOS devices, you should use a URL starting with one of your registered URLs, like `yourapp://`. For Android devices, it depends on what URLs you configured, either form is accepted.
{"_id":"5767aeb20177720e00d96884","__v":2,"editedParams":true,"link_url":"","user":"56262ffad0f87e190014c547","excerpt":"Sometimes platforms don't work the same, let's tackle this.","githubsync":"","isReference":true,"parentDoc":null,"sync_unique":"","title":"Deeplink per platform","updates":[],"api":{"method":"post","params":[{"required":true,"desc":"","default":"@ALL","type":"string","name":"targetSegmentIds","_id":"5767aeb20177720e00d96886","ref":"","in":"body"},{"type":"string","name":"notification.alert.text","_id":"57baf0d06436180e006ea3df","ref":"","in":"body","required":true,"desc":"The notification text.","default":"Hello, platform-specific deeplinks"},{"required":true,"desc":"The default targetUrl.","default":"http://www.yourwebsite,com/somePage","type":"string","name":"notification.alert.targetUrl","_id":"57baf0d06436180e006ea3de","ref":"","in":"body"},{"type":"string","name":"notification.alert.ios.targetUrl","_id":"57baf0d06436180e006ea3dd","ref":"","in":"body","required":true,"desc":"The targetUrl used only for iOS devices.","default":"yourapp://someScreen"}],"results":{"codes":[{"name":"","code":"{\"success\":true}","language":"json","status":202},{"name":"","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing notification, check either fields [campaignId, notificationId, notification]\"\n    }\n}","language":"json","status":400}]},"settings":"","url":"/deliveries","auth":"required","examples":{"codes":[{"language":"curl","code":"curl -XPOST https://api.wonderpush.com/v1/management/deliveries \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d targetSegmentIds=@ALL \\\n    -d notification='{\n    \t\t\"alert\": {\n        \t\t\"text\": \"Hello, platform-specific deeplinks\",\n            \"targetUrl\": \"http://www.yourwebsite,com/somePage\"\n            \"ios\": {\n                \"targetUrl\":\"yourapp://someScreen\"\n            }\n        }\n    }'"}]}},"body":"In this example we configured a default deeplink, and overridden it for iOS devices.\nValid platform fields are `android`, `ios` and `web`.","order":2,"project":"5626303ed0f87e190014c548","slug":"platform-specific-deeplink","type":"post","category":"5767e9a1dcda2e0e00ce3361","createdAt":"2016-06-20T08:52:02.130Z","editedParams2":true,"hidden":false,"link_external":false,"version":"5626303fd0f87e190014c54b","childrenPages":[]}

postDeeplink per platform

Sometimes platforms don't work the same, let's tackle this.

Body Params

targetSegmentIds:
required
string@ALL
notification.alert.text:
required
stringHello, platform-specific deeplinks
The notification text.
notification.alert.targetUrl:
required
stringhttp://www.yourwebsite,com/somePage
The default targetUrl.
notification.alert.ios.targetUrl:
required
stringyourapp://someScreen
The targetUrl used only for iOS devices.
In this example we configured a default deeplink, and overridden it for iOS devices. Valid platform fields are `android`, `ios` and `web`.

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 }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



In this example we configured a default deeplink, and overridden it for iOS devices. Valid platform fields are `android`, `ios` and `web`.
{"_id":"5767f011dcda2e0e00ce3383","editedParams":true,"excerpt":"Get personal.","link_url":"","project":"5626303ed0f87e190014c548","title":"Target a device","type":"post","user":"56262ffad0f87e190014c547","body":"You can find the `installationId` of a given device by viewing the timeline of a given user from any segment.\nIf you want to target several devices, then use multiple ids separated by comma.","version":"5626303fd0f87e190014c54b","editedParams2":true,"slug":"target-a-specific-device","sync_unique":"","updates":[],"__v":0,"category":"5767e9a1dcda2e0e00ce3361","createdAt":"2016-06-20T13:30:57.618Z","githubsync":"","isReference":true,"order":3,"hidden":false,"link_external":false,"parentDoc":null,"api":{"url":"/deliveries","auth":"required","examples":{"codes":[{"language":"curl","code":"curl -XPOST https://api.wonderpush.com/v1/management/deliveries \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d targetInstallationIds=someId \\\n    -d notification='{\"alert\":{\"text\":\"Hello, device!\"}}'"}]},"method":"post","params":[{"name":"targetInstallationIds","ref":"","required":true,"type":"string","in":"body","_id":"5767f011dcda2e0e00ce3385","default":"someId","desc":"Put here the `installationId` of the device to notify."},{"required":true,"type":"string","_id":"5767f011dcda2e0e00ce3384","default":"Hello, device!","desc":"The notification text.","in":"body","name":"notification.alert.text","ref":""}],"results":{"codes":[{"status":202,"language":"json","code":"{\"success\":true}","name":""},{"status":400,"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing notification, check either fields [campaignId, notificationId, notification]\"\n    }\n}","name":""}]},"settings":""},"childrenPages":[]}

postTarget a device

Get personal.

Body Params

targetInstallationIds:
required
stringsomeId
Put here the `installationId` of the device to notify.
notification.alert.text:
required
stringHello, device!
The notification text.
You can find the `installationId` of a given device by viewing the timeline of a given user from any segment. If you want to target several devices, then use multiple ids separated by comma.

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 }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



You can find the `installationId` of a given device by viewing the timeline of a given user from any segment. If you want to target several devices, then use multiple ids separated by comma.
{"_id":"5767f0c20177720e00d96974","body":"Assuming you are using the `setUserId()` method of the SDKs, your installations are now attach to a `user` object.\nThis example lets you send a notification to all the devices of a given user, using the `userId` you gave to the SDK.\nIf you want to target several users, then use multiple ids separated by comma.","order":4,"link_url":"","api":{"url":"/deliveries","auth":"required","examples":{"codes":[{"code":"curl -XPOST https://api.wonderpush.com/v1/management/deliveries \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d targetUserIds=john_doe \\\n    -d notification='{\"alert\":{\"text\":\"Hello, user!\"}}'","language":"curl"}]},"method":"post","params":[{"required":true,"type":"string","in":"body","_id":"5767f0c20177720e00d96976","default":"john_doe","desc":"Write here the `userId` of one of your users.","name":"targetUserIds","ref":""},{"ref":"","required":true,"type":"string","_id":"5767f0c20177720e00d96975","default":"Hello, user!\"}}","desc":"The notification text.","in":"body","name":"notification.alert.text"}],"results":{"codes":[{"name":"","status":202,"language":"json","code":"{\"success\":true}"},{"status":400,"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing notification, check either fields [campaignId, notificationId, notification]\"\n    }\n}","name":""}]},"settings":""},"createdAt":"2016-06-20T13:33:54.414Z","excerpt":"Notify all devices of a given user.","isReference":true,"project":"5626303ed0f87e190014c548","sync_unique":"","type":"post","__v":0,"category":"5767e9a1dcda2e0e00ce3361","editedParams":true,"editedParams2":true,"hidden":false,"updates":[],"user":"56262ffad0f87e190014c547","version":"5626303fd0f87e190014c54b","githubsync":"","link_external":false,"parentDoc":null,"slug":"target-a-specific-user","title":"Target a user","childrenPages":[]}

postTarget a user

Notify all devices of a given user.

Body Params

targetUserIds:
required
stringjohn_doe
Write here the `userId` of one of your users.
notification.alert.text:
required
stringHello, user!"}}
The notification text.
Assuming you are using the `setUserId()` method of the SDKs, your installations are now attach to a `user` object. This example lets you send a notification to all the devices of a given user, using the `userId` you gave to the SDK. If you want to target several users, then use multiple ids separated by comma.

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 }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Assuming you are using the `setUserId()` method of the SDKs, your installations are now attach to a `user` object. This example lets you send a notification to all the devices of a given user, using the `userId` you gave to the SDK. If you want to target several users, then use multiple ids separated by comma.
{"_id":"5763eb09ed68840e0076986c","excerpt":"Send a notification to a given segment of your audience.","githubsync":"","parentDoc":null,"__v":0,"api":{"settings":"","url":"/deliveries","auth":"required","examples":{"codes":[{"language":"curl","code":"curl -XPOST https://api.wonderpush.com/v1/management/deliveries \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d targetSegmentIds=01alf4nuvu34ufr2 \\\n    -d notification='{\"alert\":{\"text\":\"Hello, segment!\"}}'"}]},"method":"post","params":[{"desc":"Enter the identifier of an actual segment. You can find it on the segment preview.","name":"targetSegmentIds","ref":"","required":true,"type":"string","in":"body","_id":"5763eb09ed68840e0076986e","default":"01alf4nuvu34ufr2"},{"in":"body","name":"notification.alert.text","ref":"","required":true,"type":"string","_id":"5763eb09ed68840e0076986d","default":"Hello, segment!","desc":"The notification text."}],"results":{"codes":[{"status":202,"language":"json","code":"{\"success\":true}","name":""},{"status":400,"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing notification, check either fields [campaignId, notificationId, notification]\"\n    }\n}","name":""}]}},"category":"5767e9a1dcda2e0e00ce3361","sync_unique":"","type":"post","user":"56262ffad0f87e190014c547","editedParams2":true,"hidden":false,"slug":"target-a-segment","order":5,"updates":[],"version":"5626303fd0f87e190014c54b","createdAt":"2016-06-17T12:20:25.624Z","isReference":true,"link_url":"","project":"5626303ed0f87e190014c548","title":"Target a segment","body":"For sending a push to a subset of your users, you must create a segment first in your dashboard using rules over user installations, for example: *device platform = iOS*.\nThen, you can target this segment using the segment id you can find on the segment preview page.","editedParams":true,"link_external":false,"childrenPages":[]}

postTarget a segment

Send a notification to a given segment of your audience.

Body Params

targetSegmentIds:
required
string01alf4nuvu34ufr2
Enter the identifier of an actual segment. You can find it on the segment preview.
notification.alert.text:
required
stringHello, segment!
The notification text.
For sending a push to a subset of your users, you must create a segment first in your dashboard using rules over user installations, for example: *device platform = iOS*. Then, you can target this segment using the segment id you can find on the segment preview page.

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 }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



For sending a push to a subset of your users, you must create a segment first in your dashboard using rules over user installations, for example: *device platform = iOS*. Then, you can target this segment using the segment id you can find on the segment preview page.
{"_id":"5767eee3d88bc90e00c88d95","type":"post","__v":0,"api":{"results":{"codes":[{"status":202,"language":"json","code":"{\"success\":true}","name":""},{"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing notification, check either fields [campaignId, notificationId, notification]\"\n    }\n}","name":"","status":400}]},"settings":"","url":"/deliveries","auth":"required","examples":{"codes":[{"language":"curl","code":"curl -XPOST https://api.wonderpush.com/v1/management/deliveries \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d targetSegmentIds=id1,id2,id3 \\\n    -d notification='{\"alert\":{\"text\":\"Hello, multiple segments!\"}}'"}]},"method":"post","params":[{"in":"body","_id":"5767eee3d88bc90e00c88d97","default":"id1,id2,id3","desc":"Give multiple segment ids, separated by commas.","name":"targetSegmentIds","ref":"","required":true,"type":"array_string"},{"default":"Hello, multiple segments!","desc":"The notification text.","in":"body","name":"notification.alert.text","ref":"","required":true,"type":"string","_id":"5767eee3d88bc90e00c88d96"}]},"category":"5767e9a1dcda2e0e00ce3361","createdAt":"2016-06-20T13:25:55.691Z","link_external":false,"parentDoc":null,"editedParams":true,"editedParams2":true,"excerpt":"Send a notification to multiple segments of your audience at once.","isReference":true,"link_url":"","body":"On the contrary to sending multiple push to each single segment independently, users belonging to more than one segment will be notified only once!","hidden":false,"order":6,"project":"5626303ed0f87e190014c548","sync_unique":"","title":"Multiple segments","githubsync":"","slug":"send-to-multiple-segments","updates":[],"user":"56262ffad0f87e190014c547","version":"5626303fd0f87e190014c54b","childrenPages":[]}

postMultiple segments

Send a notification to multiple segments of your audience at once.

Body Params

targetSegmentIds:
required
array of stringsid1,id2,id3
Give multiple segment ids, separated by commas.
notification.alert.text:
required
stringHello, multiple segments!
The notification text.
On the contrary to sending multiple push to each single segment independently, users belonging to more than one segment will be notified only once!

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 }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



On the contrary to sending multiple push to each single segment independently, users belonging to more than one segment will be notified only once!
{"_id":"58131eccb9661c0f0058a0cc","api":{"examples":{"codes":[{"language":"curl","code":"curl -XPOST https://api.wonderpush.com/v1/management/deliveries \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d targetSegmentIds=a,b,c,+m,+n,+o,-x,-y,-z \\\n    -d notification='{\"alert\":{\"text\":\"Hello, combined segments!\"}}'"}]},"method":"post","params":[{"ref":"","in":"body","required":true,"desc":"Give multiple segment ids, separated by commas. Prefix mandatory segments by a +, and excluded segments by a -. Unprefixed segments are optional, but an installation must match at least one of them.","default":"a,b,c,+m,+n,+o,-x,-y,-z","type":"array_string","name":"targetSegmentIds","_id":"5767eee3d88bc90e00c88d97"},{"in":"body","required":true,"desc":"The notification text.","default":"Hello, multiple segments!","type":"string","name":"notification.alert.text","_id":"5767eee3d88bc90e00c88d96","ref":""}],"results":{"codes":[{"status":202,"language":"json","code":"{\"success\":true}","name":""},{"status":400,"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"12032\",\n        \"message\": \"segmentParams should be a JSON object or an array with a matching size. Expected size: 6\"\n    }\n}","name":""},{"status":400,"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"12032\",\n        \"message\": \"segmentParams should have either null or a JSON object in every elements. Check element number: 6\"\n    }\n}","name":null}]},"settings":"","url":"/deliveries","auth":"required"},"order":7,"parentDoc":null,"project":"5626303ed0f87e190014c548","updates":[],"version":"5626303fd0f87e190014c54b","category":"5767e9a1dcda2e0e00ce3361","link_external":false,"type":"post","__v":0,"body":"This generalizes the use of multiple segments and permits to defined mandatory and excluded segments.\nIn the above example we specified `targetSegmentIds=a,b,c,+m,+n,+o,-x,-y,-z`.\nFirst, installations must in addition match at least one segment among `a`, `b` and `c` to be candidates to being sent a notification.\nThen, installations must match both segments `m`, `n` and `o` to be kept in consideration.\nFinally, installations matching any segment `x`, `y` or `z` would be discarded.\nIn other words, it is equivalent to the following query: `(a OR b OR c) AND (m AND n AND o) AND NOT(x) AND NOT(y) AND NOT(z)`.\n\nIf you only specify excluded segments, then *all installations* except those matching the excluded segments will be sent a notification.\nNote that with only one segment, `targetSegmentIds=a` and `targetSegmentIds=+a` are equivalent.\nNote that with only one optional segment, `targetSegmentIds=a,+b,+c` and `targetSegmentIds=+a,+b,+c` are equivalent.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Going beyond matching at least one optional segment\"\n}\n[/block]\nRemember the rule: at least one of the optional segments must match an installation for it to be sent a notification.\nIf you want to get rid of this *at least one* rule, simply add an empty optional segment.\n\nSuppose you want to target base the group `a`, but also wish to expand the target to groups `m` and `n`. Do not use `targetSegmentIds=+a,m,n` as this will not match installations matching only `a` but neither `m` nor `n`. Use instead `targetSegmentIds=+a,m,n,empty`.\nNote that *for this simple case*, where there is only one mandatory segment, you could use instead `targetSegmentIds=a,m,n`.\n\nSuppose now that your base group is composed of installations matching both segments `a` and `b` (using `+a,+b`). Using `targetSegmentIds=+a,+b,m,n` would likewise not match installations matching only both segments `a` and `b` but neither `m` nor `n`. Use instead `targetSegmentIds=+a,+b,m,n,empty`.\nNote that if you drop the `+` prefix like in the simple case above, you would end up also targeting installations that match segment `a` but not `b` or `b` but not `a`, whereas your base target is clear, installations must match both segments `a` and `b`.","createdAt":"2016-10-28T09:47:56.049Z","hidden":false,"link_url":"","title":"Combine segments","excerpt":"Send a notification to multiple segments of your audience at once.","githubsync":"","isReference":true,"next":{"pages":[],"description":""},"slug":"combine-segments","sync_unique":"","user":"56262ffad0f87e190014c547","childrenPages":[]}

postCombine segments

Send a notification to multiple segments of your audience at once.

Body Params

targetSegmentIds:
required
array of stringsa,b,c,+m,+n,+o,-x,-y,-z
Give multiple segment ids, separated by commas. Prefix mandatory segments by a +, and excluded segments by a -. Unprefixed segments are optional, but an installation must match at least one of them.
notification.alert.text:
required
stringHello, multiple segments!
The notification text.
This generalizes the use of multiple segments and permits to defined mandatory and excluded segments. In the above example we specified `targetSegmentIds=a,b,c,+m,+n,+o,-x,-y,-z`. First, installations must in addition match at least one segment among `a`, `b` and `c` to be candidates to being sent a notification. Then, installations must match both segments `m`, `n` and `o` to be kept in consideration. Finally, installations matching any segment `x`, `y` or `z` would be discarded. In other words, it is equivalent to the following query: `(a OR b OR c) AND (m AND n AND o) AND NOT(x) AND NOT(y) AND NOT(z)`. If you only specify excluded segments, then *all installations* except those matching the excluded segments will be sent a notification. Note that with only one segment, `targetSegmentIds=a` and `targetSegmentIds=+a` are equivalent. Note that with only one optional segment, `targetSegmentIds=a,+b,+c` and `targetSegmentIds=+a,+b,+c` are equivalent. [block:api-header] { "type": "basic", "title": "Going beyond matching at least one optional segment" } [/block] Remember the rule: at least one of the optional segments must match an installation for it to be sent a notification. If you want to get rid of this *at least one* rule, simply add an empty optional segment. Suppose you want to target base the group `a`, but also wish to expand the target to groups `m` and `n`. Do not use `targetSegmentIds=+a,m,n` as this will not match installations matching only `a` but neither `m` nor `n`. Use instead `targetSegmentIds=+a,m,n,empty`. Note that *for this simple case*, where there is only one mandatory segment, you could use instead `targetSegmentIds=a,m,n`. Suppose now that your base group is composed of installations matching both segments `a` and `b` (using `+a,+b`). Using `targetSegmentIds=+a,+b,m,n` would likewise not match installations matching only both segments `a` and `b` but neither `m` nor `n`. Use instead `targetSegmentIds=+a,+b,m,n,empty`. Note that if you drop the `+` prefix like in the simple case above, you would end up also targeting installations that match segment `a` but not `b` or `b` but not `a`, whereas your base target is clear, installations must match both segments `a` and `b`.

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 }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



This generalizes the use of multiple segments and permits to defined mandatory and excluded segments. In the above example we specified `targetSegmentIds=a,b,c,+m,+n,+o,-x,-y,-z`. First, installations must in addition match at least one segment among `a`, `b` and `c` to be candidates to being sent a notification. Then, installations must match both segments `m`, `n` and `o` to be kept in consideration. Finally, installations matching any segment `x`, `y` or `z` would be discarded. In other words, it is equivalent to the following query: `(a OR b OR c) AND (m AND n AND o) AND NOT(x) AND NOT(y) AND NOT(z)`. If you only specify excluded segments, then *all installations* except those matching the excluded segments will be sent a notification. Note that with only one segment, `targetSegmentIds=a` and `targetSegmentIds=+a` are equivalent. Note that with only one optional segment, `targetSegmentIds=a,+b,+c` and `targetSegmentIds=+a,+b,+c` are equivalent. [block:api-header] { "type": "basic", "title": "Going beyond matching at least one optional segment" } [/block] Remember the rule: at least one of the optional segments must match an installation for it to be sent a notification. If you want to get rid of this *at least one* rule, simply add an empty optional segment. Suppose you want to target base the group `a`, but also wish to expand the target to groups `m` and `n`. Do not use `targetSegmentIds=+a,m,n` as this will not match installations matching only `a` but neither `m` nor `n`. Use instead `targetSegmentIds=+a,m,n,empty`. Note that *for this simple case*, where there is only one mandatory segment, you could use instead `targetSegmentIds=a,m,n`. Suppose now that your base group is composed of installations matching both segments `a` and `b` (using `+a,+b`). Using `targetSegmentIds=+a,+b,m,n` would likewise not match installations matching only both segments `a` and `b` but neither `m` nor `n`. Use instead `targetSegmentIds=+a,+b,m,n,empty`. Note that if you drop the `+` prefix like in the simple case above, you would end up also targeting installations that match segment `a` but not `b` or `b` but not `a`, whereas your base target is clear, installations must match both segments `a` and `b`.
{"_id":"5767fa88dcda2e0e00ce339e","excerpt":"Automate topic-based push notifications.","githubsync":"","api":{"examples":{"codes":[{"language":"curl","code":"curl -XPOST https://api.wonderpush.com/v1/management/deliveries \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d targetSegmentIds=id1 \\\n    -d segmentParams='{\"topic\":\"economics\"}' \\\n    -d notification='{\"alert\":{\"text\":\"Hello, parameterized segments!\"}}'"}]},"method":"post","params":[{"name":"targetSegmentIds","ref":"","required":true,"type":"string","in":"body","_id":"5767fa88dcda2e0e00ce33a1","default":"id1","desc":"Enter the id of your parameterized here."},{"name":"segmentParams","in":"body","_id":"5767fa88dcda2e0e00ce339f","ref":"","required":true,"desc":"Assign every segment parameter with a value.","default":"{\"topic\":\"economics\"}","type":"object"},{"in":"body","name":"notification.alert.text","ref":"","required":true,"type":"string","_id":"5767fa88dcda2e0e00ce33a0","default":"Hello, parameterized segments!","desc":"The notification text."}],"results":{"codes":[{"name":"","status":202,"language":"json","code":"{\"success\":true}"},{"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing notification, check either fields [campaignId, notificationId, notification]\"\n    }\n}","name":"","status":400}]},"settings":"","url":"/deliveries","auth":"required"},"editedParams2":true,"next":{"description":"","pages":[]},"order":8,"parentDoc":null,"sync_unique":"","title":"Parameterized segments","__v":2,"hidden":false,"project":"5626303ed0f87e190014c548","type":"post","user":"56262ffad0f87e190014c547","version":"5626303fd0f87e190014c54b","category":"5767e9a1dcda2e0e00ce3361","link_url":"","createdAt":"2016-06-20T14:15:36.719Z","editedParams":true,"isReference":true,"link_external":false,"slug":"parameterized-segments","updates":[],"body":"Imagine you have a news application where a user can follow multiple topics.\nIn the SDK you can register a user to multiple topics with something along these lines:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"WonderPush.putInstallationCustomProperties({\\n  string_followedTopics: [\\\"economics\\\", \\\"politics\\\", \\\"soccer\\\"]\\n});\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\nWe now want to automate push notifications by sending news to the users following the topic of each piece of news.\nYou likely have over a hundred different topics, maintaining an association between each topic and a `segmentId` would be cumbersome, not to mention creating a hundred segments...\nThat's where parameterized segments come in handy.\n\nLet's head over your dashboard, and create a segment with the following criterion:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[Installation custom properties (string)] [is equal to] [{{topic}}] in field [string_followedTopics]\",\n      \"language\": \"text\",\n      \"name\": \"Segment criterion\"\n    }\n  ]\n}\n[/block]\n*(The brackets represent the input forms you use to construct the criterion.)*\nSee how we gave `{{topic}}` as a value. That's how you create a parameter.\nNote the segment's id, we'll refer to it as `followsParamTopic`.\n\nWhen sending a push notification, you will now use the segment's id in `segmentIds`, and give the `followsParamTopic` segment parameter `topic` a value using a JSON object in `segmentParams`. For example: `segmentId=followsParamTopic&segmentParams={\"topic\":\"soccer\"}`.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Using multiple parameterized segments\"\n}\n[/block]\nYou can very well use multiple parameterized target segments. The parameter-to-value mapping you give as a JSON object in the `segmentParams` argument will be applied the same to all segments. This is handy because all references to `{{topic}}` would be uniformy replaced by the provided value.\nBut this may also be impractical in cases where two parameterized segments happen to use the same parameter name for different purpose, or if you use the same parameterized segment multiple times.\n\nTo further the previous example, say you want to send a notification to users following either `economics` or `politics`. You would use `targetSegmentIds=followsParamTopic,followsParamTopic` but you will have to give two different values in turn, for the first occurrence of the segment and its second occurrence.\nTo this end, simply give a JSON array of 2 parameter-to-value mappings: `segmentParams=[{\"topic\":\"economics\"},{\"topic\":\"politics\"}]`.\n\nIf you use a JSON array for `segmentParams`, its length must match the number of ids given in `targetSegmentIds`. For example the above `targetSegmentIds=followsParamTopic,followsParamTopic` uses 2 segments and `targetSegmentIds=a,b,+m,-x` uses 4 segments.\nThe parameter-to-value mappings in the `segmentParams` array must correspond to the segments in the same position in `targetSegmentIds`.\nYou must use either `null` or `{}` for non-parameterized segments.\n\nFor example, following the same example as before, if you add the `+subscribedToTopicNotifications` mandatory non-parameterized segment, you would use the following arguments: `targetSegmentIds=+subscribedToTopicNotifications,followsParamTopic,followsParamTopic&segmentParams=[null,{\"topic\":\"economics\"},{\"topic\":\"politics\"}]`. We put `null` in the first position because `subscribedToTopicNotifications` is mentioned in the first position inside `targetSegmentIds`.","childrenPages":[]}

postParameterized segments

Automate topic-based push notifications.

Body Params

targetSegmentIds:
required
stringid1
Enter the id of your parameterized here.
segmentParams:
required
object{"topic":"economics"}
Assign every segment parameter with a value.
notification.alert.text:
required
stringHello, parameterized segments!
The notification text.
Imagine you have a news application where a user can follow multiple topics. In the SDK you can register a user to multiple topics with something along these lines: [block:code] { "codes": [ { "code": "WonderPush.putInstallationCustomProperties({\n string_followedTopics: [\"economics\", \"politics\", \"soccer\"]\n});", "language": "javascript" } ] } [/block] We now want to automate push notifications by sending news to the users following the topic of each piece of news. You likely have over a hundred different topics, maintaining an association between each topic and a `segmentId` would be cumbersome, not to mention creating a hundred segments... That's where parameterized segments come in handy. Let's head over your dashboard, and create a segment with the following criterion: [block:code] { "codes": [ { "code": "[Installation custom properties (string)] [is equal to] [{{topic}}] in field [string_followedTopics]", "language": "text", "name": "Segment criterion" } ] } [/block] *(The brackets represent the input forms you use to construct the criterion.)* See how we gave `{{topic}}` as a value. That's how you create a parameter. Note the segment's id, we'll refer to it as `followsParamTopic`. When sending a push notification, you will now use the segment's id in `segmentIds`, and give the `followsParamTopic` segment parameter `topic` a value using a JSON object in `segmentParams`. For example: `segmentId=followsParamTopic&segmentParams={"topic":"soccer"}`. [block:api-header] { "type": "basic", "title": "Using multiple parameterized segments" } [/block] You can very well use multiple parameterized target segments. The parameter-to-value mapping you give as a JSON object in the `segmentParams` argument will be applied the same to all segments. This is handy because all references to `{{topic}}` would be uniformy replaced by the provided value. But this may also be impractical in cases where two parameterized segments happen to use the same parameter name for different purpose, or if you use the same parameterized segment multiple times. To further the previous example, say you want to send a notification to users following either `economics` or `politics`. You would use `targetSegmentIds=followsParamTopic,followsParamTopic` but you will have to give two different values in turn, for the first occurrence of the segment and its second occurrence. To this end, simply give a JSON array of 2 parameter-to-value mappings: `segmentParams=[{"topic":"economics"},{"topic":"politics"}]`. If you use a JSON array for `segmentParams`, its length must match the number of ids given in `targetSegmentIds`. For example the above `targetSegmentIds=followsParamTopic,followsParamTopic` uses 2 segments and `targetSegmentIds=a,b,+m,-x` uses 4 segments. The parameter-to-value mappings in the `segmentParams` array must correspond to the segments in the same position in `targetSegmentIds`. You must use either `null` or `{}` for non-parameterized segments. For example, following the same example as before, if you add the `+subscribedToTopicNotifications` mandatory non-parameterized segment, you would use the following arguments: `targetSegmentIds=+subscribedToTopicNotifications,followsParamTopic,followsParamTopic&segmentParams=[null,{"topic":"economics"},{"topic":"politics"}]`. We put `null` in the first position because `subscribedToTopicNotifications` is mentioned in the first position inside `targetSegmentIds`.

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 }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Imagine you have a news application where a user can follow multiple topics. In the SDK you can register a user to multiple topics with something along these lines: [block:code] { "codes": [ { "code": "WonderPush.putInstallationCustomProperties({\n string_followedTopics: [\"economics\", \"politics\", \"soccer\"]\n});", "language": "javascript" } ] } [/block] We now want to automate push notifications by sending news to the users following the topic of each piece of news. You likely have over a hundred different topics, maintaining an association between each topic and a `segmentId` would be cumbersome, not to mention creating a hundred segments... That's where parameterized segments come in handy. Let's head over your dashboard, and create a segment with the following criterion: [block:code] { "codes": [ { "code": "[Installation custom properties (string)] [is equal to] [{{topic}}] in field [string_followedTopics]", "language": "text", "name": "Segment criterion" } ] } [/block] *(The brackets represent the input forms you use to construct the criterion.)* See how we gave `{{topic}}` as a value. That's how you create a parameter. Note the segment's id, we'll refer to it as `followsParamTopic`. When sending a push notification, you will now use the segment's id in `segmentIds`, and give the `followsParamTopic` segment parameter `topic` a value using a JSON object in `segmentParams`. For example: `segmentId=followsParamTopic&segmentParams={"topic":"soccer"}`. [block:api-header] { "type": "basic", "title": "Using multiple parameterized segments" } [/block] You can very well use multiple parameterized target segments. The parameter-to-value mapping you give as a JSON object in the `segmentParams` argument will be applied the same to all segments. This is handy because all references to `{{topic}}` would be uniformy replaced by the provided value. But this may also be impractical in cases where two parameterized segments happen to use the same parameter name for different purpose, or if you use the same parameterized segment multiple times. To further the previous example, say you want to send a notification to users following either `economics` or `politics`. You would use `targetSegmentIds=followsParamTopic,followsParamTopic` but you will have to give two different values in turn, for the first occurrence of the segment and its second occurrence. To this end, simply give a JSON array of 2 parameter-to-value mappings: `segmentParams=[{"topic":"economics"},{"topic":"politics"}]`. If you use a JSON array for `segmentParams`, its length must match the number of ids given in `targetSegmentIds`. For example the above `targetSegmentIds=followsParamTopic,followsParamTopic` uses 2 segments and `targetSegmentIds=a,b,+m,-x` uses 4 segments. The parameter-to-value mappings in the `segmentParams` array must correspond to the segments in the same position in `targetSegmentIds`. You must use either `null` or `{}` for non-parameterized segments. For example, following the same example as before, if you add the `+subscribedToTopicNotifications` mandatory non-parameterized segment, you would use the following arguments: `targetSegmentIds=+subscribedToTopicNotifications,followsParamTopic,followsParamTopic&segmentParams=[null,{"topic":"economics"},{"topic":"politics"}]`. We put `null` in the first position because `subscribedToTopicNotifications` is mentioned in the first position inside `targetSegmentIds`.
{"_id":"57680625d8067e1900fc81c2","editedParams":true,"editedParams2":true,"isReference":true,"link_external":false,"slug":"trigger-a-campaign","user":"56262ffad0f87e190014c547","__v":0,"body":"When you create a manual campaign, you can trigger it manually using the *FIRE* button, or use this call to trigger it automatically, giving only the `campaignId` parameter.","excerpt":"Automate manual campaigns.","hidden":false,"parentDoc":null,"type":"post","api":{"url":"/deliveries","auth":"required","examples":{"codes":[{"language":"curl","code":"curl -XPOST https://api.wonderpush.com/v1/management/deliveries \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d campaignId=someId"}]},"method":"post","params":[{"name":"campaignId","ref":"","required":true,"type":"string","in":"body","_id":"57680625d8067e1900fc81c3","default":"someId","desc":"Fill this with the identifier of the campaign to trigger."}],"results":{"codes":[{"code":"{\"success\":true}","name":"","status":202,"language":"json"},{"status":400,"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing notification, check either fields [campaignId, notificationId, notification]\"\n    }\n}","name":""}]},"settings":""},"createdAt":"2016-06-20T15:05:09.190Z","sync_unique":"","title":"Trigger a campaign","category":"5767e9a1dcda2e0e00ce3361","project":"5626303ed0f87e190014c548","link_url":"","order":9,"updates":[],"version":"5626303fd0f87e190014c54b","githubsync":"","childrenPages":[]}

postTrigger a campaign

Automate manual campaigns.

Body Params

campaignId:
required
stringsomeId
Fill this with the identifier of the campaign to trigger.
When you create a manual campaign, you can trigger it manually using the *FIRE* button, or use this call to trigger it automatically, giving only the `campaignId` parameter.

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 }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



When you create a manual campaign, you can trigger it manually using the *FIRE* button, or use this call to trigger it automatically, giving only the `campaignId` parameter.
{"_id":"576810d0dcda2e0e00ce33dd","title":"Using views","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -XPOST https://api.wonderpush.com/v1/management/deliveries \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d viewId=someViewId \\\n    -d targetSegmentIds=someSegmentId \\\n    -d notification='{\"alert\":{\"text\":\"Hello, views!\"}}'"}]},"method":"post","params":[{"required":true,"desc":"The id of the view to use.","default":"someViewId","type":"string","name":"viewId","in":"body","_id":"576810d0dcda2e0e00ce33e0","ref":""},{"ref":"","required":true,"type":"string","in":"body","_id":"576810d0dcda2e0e00ce33df","default":"someSegmentId","desc":"The id of a segment","name":"targetSegmentIds"},{"_id":"576810d0dcda2e0e00ce33de","default":"Hello, views!","desc":"The notification text.","in":"body","name":"notification.alert.text","ref":"","required":true,"type":"string"}],"results":{"codes":[{"status":202,"language":"json","code":"{\"success\":true}","name":""},{"status":400,"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing notification, check either fields [campaignId, notificationId, notification]\"\n    }\n}","name":""}]},"settings":"","url":"/deliveries"},"category":"5767e9a1dcda2e0e00ce3361","createdAt":"2016-06-20T15:50:40.327Z","githubsync":"","link_url":"","parentDoc":null,"user":"56262ffad0f87e190014c547","body":"Every object you use – campaign or segment – must belong to the same view for the call to be accepted. Segments from the full view (the empty view id) can be dynamically scoped within a view. That makes it possible to mix objects within a given view with objects from the full view, simply by specifying the `viewId` parameter.\n\nLet's say you want to restrict a segment created in the Full view, to a specific view instead, UK users for instance. Get the id of the view from your dashboard, and simply use it in the `viewId` parameter.","excerpt":"How does segments and campaigns play with views.","link_external":false,"order":10,"sync_unique":"","__v":0,"editedParams":true,"editedParams2":true,"hidden":false,"isReference":true,"version":"5626303fd0f87e190014c54b","project":"5626303ed0f87e190014c548","slug":"using-views","type":"post","updates":[],"childrenPages":[]}

postUsing views

How does segments and campaigns play with views.

Body Params

viewId:
required
stringsomeViewId
The id of the view to use.
targetSegmentIds:
required
stringsomeSegmentId
The id of a segment
notification.alert.text:
required
stringHello, views!
The notification text.
Every object you use – campaign or segment – must belong to the same view for the call to be accepted. Segments from the full view (the empty view id) can be dynamically scoped within a view. That makes it possible to mix objects within a given view with objects from the full view, simply by specifying the `viewId` parameter. Let's say you want to restrict a segment created in the Full view, to a specific view instead, UK users for instance. Get the id of the view from your dashboard, and simply use it in the `viewId` parameter.

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 }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Every object you use – campaign or segment – must belong to the same view for the call to be accepted. Segments from the full view (the empty view id) can be dynamically scoped within a view. That makes it possible to mix objects within a given view with objects from the full view, simply by specifying the `viewId` parameter. Let's say you want to restrict a segment created in the Full view, to a specific view instead, UK users for instance. Get the id of the view from your dashboard, and simply use it in the `viewId` parameter.
{"_id":"577e8f56a74eb40e00d97b63","category":"577e8f29a326490e000b73a0","isReference":true,"excerpt":"Personalize the picture of your notification dynamically. By default, web push contain the default icon you defined through your dashboard.","link_external":false,"link_url":"","slug":"web-add-a-picture","updates":[],"version":"5626303fd0f87e190014c54b","body":"","api":{"method":"post","params":[{"name":"notification.alert.web.icon","ref":"","required":true,"type":"string","_id":"57baea0f5c849b1700f1e4f8","default":"https://imgur.com/o1zLLBI.png","desc":"What picture should be displayed next to the text, prefer HTTPS.","in":"body"},{"_id":"57baea0f5c849b1700f1e4f7","default":"Hello, picture!","desc":"The notification text.","in":"body","name":"notification.alert.text","ref":"","required":true,"type":"string"},{"name":"targetSegmentIds","_id":"57baea0f5c849b1700f1e4f6","ref":"","in":"body","required":true,"desc":"You can also use any other available targeting.","default":"@ALL","type":"string"}],"results":{"codes":[{"status":202,"language":"json","code":"{\"success\":true}","name":""},{"status":400,"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing notification, check either fields [campaignId, notificationId, notification]\"\n    }\n}","name":""}]},"settings":"","url":"/deliveries","auth":"required","examples":{"codes":[{"code":"curl -XPOST https://api.wonderpush.com/v1/management/deliveries \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d targetSegmentIds=@ALL \\\n    -d notification='{\"alert\":{\"text\":\"Hello, picture!\",\"web\":{\"icon\":\"https://imgur.com/o1zLLBI.png\"}}}'","language":"shell","name":"cURL"}]}},"createdAt":"2016-07-07T17:20:22.938Z","githubsync":"","hidden":false,"order":0,"parentDoc":null,"project":"5626303ed0f87e190014c548","__v":2,"type":"post","title":"Add a picture","user":"56262ffad0f87e190014c547","sync_unique":"","childrenPages":[]}

postAdd a picture

Personalize the picture of your notification dynamically. By default, web push contain the default icon you defined through your dashboard.

Body Params

notification.alert.web.icon:
required
stringhttps://imgur.com/o1zLLBI.png
What picture should be displayed next to the text, prefer HTTPS.
notification.alert.text:
required
stringHello, picture!
The notification text.
targetSegmentIds:
required
string@ALL
You can also use any other available targeting.

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 }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"593e5a831d433b000f10e219","project":"5626303ed0f87e190014c548","version":"5626303fd0f87e190014c54b","category":"577e8f29a326490e000b73a0","user":"56262ffad0f87e190014c547","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-06-12T09:10:27.428Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[{"status":202,"language":"json","code":"{\"success\":true}","name":""},{"status":400,"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing notification, check either fields [campaignId, notificationId, notification]\"\n    }\n}","name":""}]},"method":"post","examples":{"codes":[{"code":"curl -XPOST https://api.wonderpush.com/v1/management/deliveries \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d targetSegmentIds=@ALL \\\n    -d notification='{\"alert\":{\"text\":\"Hello, big picture!\",\"web\":{\"image\":\"http://imgur.com/EsSp1oH.png\"}}}'","language":"shell","name":"cURL"}]},"auth":"required","params":[{"_id":"57bae84f5c849b1700f1e4f3","ref":"","in":"body","required":true,"desc":"The big picture to display in the notification.","default":"http://imgur.com/EsSp1oH.png","type":"string","name":"notification.alert.web.image"},{"_id":"57baeebd5c849b1700f1e4f9","ref":"","in":"body","required":true,"desc":"The notification text.","default":"Hello, big picture!","type":"string","name":"notification.alert.text"},{"_id":"57bae84f5c849b1700f1e4f2","ref":"","in":"body","required":true,"desc":"You can also use any other available targeting.","default":"@ALL","type":"string","name":"targetSegmentIds"}],"url":"/deliveries"},"isReference":true,"order":1,"body":"The notification will show a big, beautiful and impacting picture.\nYou can combine this with an icon.","excerpt":"An image is worth a thousand words.","slug":"web-add-a-big-picture","type":"post","title":"Add a big picture","__v":0,"parentDoc":null,"childrenPages":[]}

postAdd a big picture

An image is worth a thousand words.

Body Params

notification.alert.web.image:
required
stringhttp://imgur.com/EsSp1oH.png
The big picture to display in the notification.
notification.alert.text:
required
stringHello, big picture!
The notification text.
targetSegmentIds:
required
string@ALL
You can also use any other available targeting.
The notification will show a big, beautiful and impacting picture. You can combine this with an icon.

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 }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



The notification will show a big, beautiful and impacting picture. You can combine this with an icon.
{"_id":"57681176dcda2e0e00ce33e4","body":"Android and Web devices will display this square image next to the text.\nYour application icon will leave room for that image instead and appear as a small bubble.","createdAt":"2016-06-20T15:53:26.592Z","slug":"android-add-a-large-icon","isReference":true,"link_external":false,"parentDoc":null,"title":"Add a large icon","user":"56262ffad0f87e190014c547","version":"5626303fd0f87e190014c54b","hidden":false,"order":0,"project":"5626303ed0f87e190014c548","sync_unique":"","type":"post","updates":[],"__v":4,"api":{"auth":"required","examples":{"codes":[{"name":"cURL","language":"shell","code":"curl -XPOST https://api.wonderpush.com/v1/management/deliveries \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d targetSegmentIds=@ALL \\\n    -d notification='{\"alert\":{\"text\":\"Hello, picture!\",\"android\":{\"largeIcon\":\"http://imgur.com/o1zLLBI.png\"}}}'"}]},"method":"post","params":[{"name":"notification.alert.android.largeIcon","ref":"","required":true,"type":"string","_id":"57bae555afc18c0e00529c35","default":"http://imgur.com/o1zLLBI.png","desc":"What picture should be displayed next to the text.","in":"body"},{"type":"string","_id":"57bae61b7c05760e003453e0","default":"Hello, picture!","desc":"The notification text.","in":"body","name":"notification.alert.text","ref":"","required":true},{"type":"string","name":"targetSegmentIds","_id":"57bae555afc18c0e00529c36","ref":"","in":"body","required":true,"desc":"You can also use any other available targeting.","default":"@ALL"}],"results":{"codes":[{"status":202,"language":"json","code":"{\"success\":true}","name":""},{"status":400,"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing notification, check either fields [campaignId, notificationId, notification]\"\n    }\n}","name":""}]},"settings":"","url":"/deliveries"},"category":"57693a611f52a00e006a958a","excerpt":"Attract the users' eyes with beautiful icons.","githubsync":"","link_url":"","childrenPages":[]}

postAdd a large icon

Attract the users' eyes with beautiful icons.

Body Params

notification.alert.android.largeIcon:
required
stringhttp://imgur.com/o1zLLBI.png
What picture should be displayed next to the text.
notification.alert.text:
required
stringHello, picture!
The notification text.
targetSegmentIds:
required
string@ALL
You can also use any other available targeting.
Android and Web devices will display this square image next to the text. Your application icon will leave room for that image instead and appear as a small bubble.

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 }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Android and Web devices will display this square image next to the text. Your application icon will leave room for that image instead and appear as a small bubble.
{"_id":"576811c1a151c10e0043169c","__v":3,"createdAt":"2016-06-20T15:54:41.866Z","githubsync":"","isReference":true,"link_url":"","version":"5626303fd0f87e190014c54b","api":{"auth":"required","examples":{"codes":[{"code":"curl -XPOST https://api.wonderpush.com/v1/management/deliveries \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d targetSegmentIds=@ALL \\\n    -d notification='{\"alert\":{\"text\":\"Hello, big picture!\",\"android\":{\"type\":\"bigPicture\",\"bigPicture\":\"http://imgur.com/EsSp1oH.png\"}}}'","language":"shell","name":"cURL"}]},"method":"post","params":[{"type":"string","_id":"57bae84f5c849b1700f1e4f4","default":"bigPicture","desc":"You have to explicitly use the `bigPicture` notification type.","in":"body","name":"notification.alert.android.type","ref":"","required":true},{"default":"http://imgur.com/EsSp1oH.png","desc":"The big picture to display when the notification is expanded.","in":"body","name":"notification.alert.android.bigPicture","ref":"","required":true,"type":"string","_id":"57bae84f5c849b1700f1e4f3"},{"ref":"","required":true,"type":"string","_id":"57baeebd5c849b1700f1e4f9","default":"Hello, big picture!","desc":"The notification text.","in":"body","name":"notification.alert.text"},{"in":"body","required":true,"desc":"You can also use any other available targeting.","default":"@ALL","type":"string","name":"targetSegmentIds","_id":"57bae84f5c849b1700f1e4f2","ref":""}],"results":{"codes":[{"status":202,"language":"json","code":"{\"success\":true}","name":""},{"status":400,"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing notification, check either fields [campaignId, notificationId, notification]\"\n    }\n}","name":""}]},"settings":"","url":"/deliveries"},"order":1,"parentDoc":null,"slug":"android-add-a-big-picture","category":"57693a611f52a00e006a958a","excerpt":"An image is worth a thousand words.","link_external":false,"updates":[],"user":"56262ffad0f87e190014c547","body":"Android devices will show a big, beautiful and impacting picture when the notification is expanded.\nYou can combine this with a large icon.","hidden":false,"project":"5626303ed0f87e190014c548","sync_unique":"","title":"Add a big picture","type":"post","childrenPages":[]}

postAdd a big picture

An image is worth a thousand words.

Body Params

notification.alert.android.type:
required
stringbigPicture
You have to explicitly use the `bigPicture` notification type.
notification.alert.android.bigPicture:
required
stringhttp://imgur.com/EsSp1oH.png
The big picture to display when the notification is expanded.
notification.alert.text:
required
stringHello, big picture!
The notification text.
targetSegmentIds:
required
string@ALL
You can also use any other available targeting.
Android devices will show a big, beautiful and impacting picture when the notification is expanded. You can combine this with a large icon.

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 }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Android devices will show a big, beautiful and impacting picture when the notification is expanded. You can combine this with a large icon.
{"_id":"5763dff1e3e44d0e000a4d76","createdAt":"2016-06-17T11:33:05.307Z","excerpt":"Gimme all powerz!","sync_unique":"","type":"basic","api":{"url":"","auth":"required","params":[],"results":{"codes":[{"language":"json","code":"{}","name":"","status":200},{"code":"{}","name":"","status":400,"language":"json"}]},"settings":""},"link_external":false,"project":"5626303ed0f87e190014c548","version":"5626303fd0f87e190014c54b","__v":2,"isReference":true,"link_url":"","order":0,"title":"Reference","category":"5763c690e3e44d0e000a4d41","hidden":false,"parentDoc":null,"slug":"reference","updates":[],"user":"56262ffad0f87e190014c547","body":"You will find below the full list of end-points, arguments, and object fields.","githubsync":"","childrenPages":[]}

Reference

Gimme all powerz!

You will find below the full list of end-points, arguments, and object fields.
You will find below the full list of end-points, arguments, and object fields.
{"_id":"5763c17f11b88b0e009c0dee","editedParams":true,"hidden":false,"link_url":"","parentDoc":null,"sync_unique":"","title":"/deliveries","__v":14,"user":"56262ffad0f87e190014c547","isReference":true,"next":{"pages":[],"description":""},"project":"5626303ed0f87e190014c548","type":"post","version":"5626303fd0f87e190014c54b","api":{"settings":"","url":"/deliveries","auth":"required","examples":{"codes":[{"language":"curl","code":"curl -XPOST https://api.wonderpush.com/v1/management/deliveries \\\n\t\t-d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d targetSegmentIds=@ALL \\\n    -d notification='{\"alert\":{text\":\"Hello, Management API!\"}}'"},{"code":"<?php\n\n$ch = curl_init();\n\ncurl_setopt($ch, CURLOPT_URL, \"https://api.wonderpush.com/v1/management/deliveries\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array(\n\t  'accessToken' => \"YOUR_APPLICATION_ACCESS_TOKEN\",\n\t  'targetSegmentIds' => '@ALL',\n  \t'notification' => json_encode(['alert'=>['text'=>\"Hello, Management API!\"]])\n)));\n\n$rawResponse = curl_exec($ch);\n\nif (curl_errno($ch)) {\n\n    echo 'Error: ' . curl_error($ch);\n\n} else {\n\n    $response = json_decode($rawResponse, true);\n    if (isset($response['success']) && $response['success'] === true) {\n        echo 'Success';\n    } else if (isset($response['error']['status'])\n               && isset($response['error']['code'])\n               && isset($response['error']['message'])) {\n        echo 'Error ' . $response['error']['status']\n          . ' code ' . $response['error']['code']\n          . ': ' . $response['error']['message'];\n    } else {\n        echo 'Error: ' . $rawResponse;\n    }\n\n}\n\ncurl_close($ch);\n\n?>","language":"php"}]},"method":"post","params":[{"ref":"","required":false,"desc":"A notification object describing the content to be pushed.","default":"","type":"object","name":"notification","in":"body","_id":"57681ff7dcda2e0e00ce3404"},{"type":"object","name":"notificationOverride","in":"body","_id":"5763ca5e2884ab0e00fb0237","ref":"","required":false,"desc":"Partial JSON body to apply to the notification before using it. Permits overriding a text, custom key-value payload, etc. If giving a null notificationId, it creates one on the fly just like if `notification` was used instead.","default":""},{"ref":"","required":false,"type":"object","_id":"5763e0c12884ab0e00fb0272","default":"","desc":"JSON dictionary of parameters with their associated values to be applied to the notification. Providing a value to a parameter \"foo\" will replace all occurences of \"{{foo}}\" with the given value. If you targetted multiple installations or users without using segments, you can also give different values for each targetted value by giving a JSON array of dictionaries, respecting the same order.","in":"body","name":"notificationParams"},{"required":false,"desc":"Source notification id. Chosen automatically from the source campaign, if possible.","default":"","type":"string","name":"notificationId","in":"body","_id":"5763e0c12884ab0e00fb0273","ref":""},{"in":"body","name":"targetSegmentIds","ref":"","required":false,"type":"array_string","_id":"5763c17f11b88b0e009c0def","default":"","desc":"Target segment ids. All matching installations will be notified. Every segment must share the same view id. You can prefix ids with a `+` to make them mandatory, or a `-` to make them forbidden, otherwise a segment is optional. An installation must match all mandatory segments, no forbidden segments and at least one optional segment to be notified."},{"name":"targetSegmentBody","in":"body","_id":"5763e0c12884ab0e00fb0270","ref":"","required":false,"desc":"Target segment body. All matching installations will be notified. Combines with any given view id.","default":"","type":"object"},{"default":"","type":"array_string","name":"targetUserIds","in":"body","_id":"5763e0c12884ab0e00fb026f","ref":"","required":false,"desc":"Target user ids. All their installations will be notified."},{"in":"body","_id":"5763e0c12884ab0e00fb026e","ref":"","required":false,"desc":"Target installation ids. Only the given installations will be notified.","default":"","type":"array_string","name":"targetInstallationIds"},{"name":"targetDeviceIds","in":"body","_id":"5763e0c12884ab0e00fb026d","ref":"","required":false,"desc":"Target device ids. Must be prefixed by their corresponding platforms, followed by a colon \":\". Only the corresponding installations will be notified.","default":"","type":"array_string"},{"default":"","type":"array_string","name":"targetPushTokens","in":"body","_id":"5763e0c12884ab0e00fb026c","ref":"","required":false,"desc":"Target push tokens. Must be prefixed by their corresponding platforms, followed by a colon \":\". Only the corresponding installations will be notified."},{"_id":"5763e0c12884ab0e00fb026b","ref":"","required":false,"desc":"Target installations' access tokens. Only the corresponding installations will be notified.","default":"","type":"array_string","name":"targetAccessTokens","in":"body"},{"type":"object","_id":"5763e0c12884ab0e00fb0271","default":"","desc":"JSON dictionary of parameters with their associated values to be applied to the segment. Providing a value to a parameter `foo` will replace all occurences of `{{foo}}` with the given value. If you use multiple segments and want to give different values to parameters using the same name, you can give an JSON array of dictionnaries, respecting the order of the segments given in targetSegmentIds. Segments that need no parameters can use `null` or an empty object.","in":"body","name":"segmentParams","ref":"","required":false},{"name":"campaignId","in":"body","_id":"5763ca5e2884ab0e00fb0236","ref":"","required":false,"desc":"An optional campaign identifier to attach statistics to.","default":"","type":"string"},{"default":"","type":"string","name":"viewId","in":"body","_id":"5763e0c12884ab0e00fb0274","ref":"","required":false,"desc":"Optional view id to apply over all segments defined in the Full view. All segments must use the same view, or the call will be refused. If a campaignId is given, it must share the same view."}],"results":{"codes":[{"code":"{\"success\":true}","language":"json","status":202,"name":""},{"name":"","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing notification, check either fields [campaignId, notificationId, notification]\"\n    }\n}","language":"json","status":400},{"name":"Invalid JSON or non UTF-8 encoding","status":400,"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"notification: invalid value \\\"<BINARY>\\\"! valid values are json string\"\n    }\n}"}]}},"category":"5763c690e3e44d0e000a4d41","createdAt":"2016-06-17T09:23:11.605Z","excerpt":"Programmatically send notifications.","githubsync":"","order":1,"slug":"post-deliveries","body":"This end-point permits you to send push notifications programmatically.\n\nSend push notifications to multiple targets. Only one target type is allowed at a time. Multiple values are separated by commas, some need to be prefixed by the corresponding platform. Only 100 values are allowed per call. If you give no target but give a campaign, the campaign will be triggered.\n\n*NOTE:* The below test tool will not work because readme.io will send all the target fields even if left empty. We're are waiting for their support to improve on this.","link_external":false,"updates":[],"editedParams2":true,"childrenPages":[]}

post/deliveries

Programmatically send notifications.

Body Params

notification:
object
A notification object describing the content to be pushed.
notificationOverride:
object
Partial JSON body to apply to the notification before using it. Permits overriding a text, custom key-value payload, etc. If giving a null notificationId, it creates one on the fly just like if `notification` was used instead.
notificationParams:
object
JSON dictionary of parameters with their associated values to be applied to the notification. Providing a value to a parameter "foo" will replace all occurences of "{{foo}}" with the given value. If you targetted multiple installations or users without using segments, you can also give different values for each targetted value by giving a JSON array of dictionaries, respecting the same order.
notificationId:
string
Source notification id. Chosen automatically from the source campaign, if possible.
targetSegmentIds:
array of strings
Target segment ids. All matching installations will be notified. Every segment must share the same view id. You can prefix ids with a `+` to make them mandatory, or a `-` to make them forbidden, otherwise a segment is optional. An installation must match all mandatory segments, no forbidden segments and at least one optional segment to be notified.
targetSegmentBody:
object
Target segment body. All matching installations will be notified. Combines with any given view id.
targetUserIds:
array of strings
Target user ids. All their installations will be notified.
targetInstallationIds:
array of strings
Target installation ids. Only the given installations will be notified.
targetDeviceIds:
array of strings
Target device ids. Must be prefixed by their corresponding platforms, followed by a colon ":". Only the corresponding installations will be notified.
targetPushTokens:
array of strings
Target push tokens. Must be prefixed by their corresponding platforms, followed by a colon ":". Only the corresponding installations will be notified.
targetAccessTokens:
array of strings
Target installations' access tokens. Only the corresponding installations will be notified.
segmentParams:
object
JSON dictionary of parameters with their associated values to be applied to the segment. Providing a value to a parameter `foo` will replace all occurences of `{{foo}}` with the given value. If you use multiple segments and want to give different values to parameters using the same name, you can give an JSON array of dictionnaries, respecting the order of the segments given in targetSegmentIds. Segments that need no parameters can use `null` or an empty object.
campaignId:
string
An optional campaign identifier to attach statistics to.
viewId:
string
Optional view id to apply over all segments defined in the Full view. All segments must use the same view, or the call will be refused. If a campaignId is given, it must share the same view.
This end-point permits you to send push notifications programmatically. Send push notifications to multiple targets. Only one target type is allowed at a time. Multiple values are separated by commas, some need to be prefixed by the corresponding platform. Only 100 values are allowed per call. If you give no target but give a campaign, the campaign will be triggered. *NOTE:* The below test tool will not work because readme.io will send all the target fields even if left empty. We're are waiting for their support to improve on this.

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 }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



This end-point permits you to send push notifications programmatically. Send push notifications to multiple targets. Only one target type is allowed at a time. Multiple values are separated by commas, some need to be prefixed by the corresponding platform. Only 100 values are allowed per call. If you give no target but give a campaign, the campaign will be triggered. *NOTE:* The below test tool will not work because readme.io will send all the target fields even if left empty. We're are waiting for their support to improve on this.
{"_id":"5763c89587bd760e00c31ab3","excerpt":"Simple, silent, rich, with an in-app… One object to represent them all.","order":2,"parentDoc":null,"sync_unique":"","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"","auth":"required","params":[]},"body":"This objects represents what the user will see. It is split into 3 main fields: `alert`, `inApp` and `push`. The first one controls what the user will see in the notification center, the second one controls an optional message to show on top of your application once the notification is clicked, and the last one controls various payload and push options.\n\nThe simplest form of notification you can create contains only a text alert:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\\"alert\\\":{\\\"text\\\": \\\"Hello, WonderPush!\\\"}}\",\n      \"language\": \"json\",\n      \"name\": \"Basic notification\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Alert\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"alert.text\",\n    \"1-0\": \"alert.title\",\n    \"2-0\": \"alert.targetUrl\",\n    \"3-0\": \"alert.actions\",\n    \"4-0\": \"alert.ios\",\n    \"5-0\": \"alert.android\",\n    \"6-0\": \"alert.web\",\n    \"0-1\": \"string\",\n    \"1-1\": \"string\",\n    \"2-1\": \"a URL\",\n    \"3-1\": \"array of objects\",\n    \"4-1\": \"object\",\n    \"5-1\": \"object\",\n    \"6-1\": \"object\",\n    \"0-2\": \"The message to display in the notification center.\",\n    \"1-2\": \"The title of the notification to display in the notification center.\",\n    \"2-2\": \"The content that should be displayed when the user clicks the notification.\\n\\n* missing, `null` or `wonderpush://notificationOpen/default`, the default.\\n  Simply shows the application.\\n* any deeplink URL (eg.: `yourapp://targetScreen?someParams`)\\n  The OS of the user device will resolve this accordingly.\\n* any HTTP URL (eg.: `https://www.yourwebsite.com/somePage?someTrackingInfo`)\\n  The OS of the user device will resolve this accordingly.\\n  It will point to your application if supported, or else will open the web browser.\\n* `wonderpush://notificationOpen/broadcast`\\n  Lets application code decide what screen to launch.\\n* `wonderpush://notificationOpen/noop`\\n  Performs no action. Use this for your notification buttons. Clicking the notification itself should always have some visible feedback so avoid this value.\\n\\nMore info on how to handle your own deeplinks: [Android](http://www.wonderpush.com/docs/android/getting-started#android-getting-started-advanced-usage-own-deep-links), [iOS](http://www.wonderpush.com/docs/ios/getting-started#ios-getting-started-advanced-usage-own-deep-links).\",\n    \"3-2\": \"An optional list of background actions to perform when the user clicks the notification.\",\n    \"4-2\": \"iOS specific options\",\n    \"5-2\": \"Android specific options\",\n    \"6-2\": \"Web specific options\"\n  },\n  \"cols\": 3,\n  \"rows\": 7\n}\n[/block]\n----\n\nThe following table presents the iOS specific options that can be user in the `alert.ios` field:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"alert.ios.sound\",\n    \"0-1\": \"string\",\n    \"3-0\": \"alert.ios.titleLocArgs\",\n    \"4-0\": \"alert.ios.body\",\n    \"5-0\": \"alert.ios.locKey\",\n    \"6-0\": \"alert.ios.locArgs\",\n    \"7-0\": \"alert.ios.actionLocKey\",\n    \"8-0\": \"alert.ios.launchImage\",\n    \"2-0\": \"alert.ios.titleLocKey\",\n    \"1-0\": \"alert.ios.badge\",\n    \"1-1\": \"integer\",\n    \"9-0\": \"alert.ios.category\",\n    \"15-0\": \"alert.ios.contentAvailable\",\n    \"2-1\": \"string\",\n    \"3-1\": \"array of string\",\n    \"4-1\": \"string\",\n    \"5-1\": \"string\",\n    \"6-1\": \"array of string\",\n    \"7-1\": \"string\",\n    \"8-1\": \"string\",\n    \"9-1\": \"string\",\n    \"15-1\": \"integer\",\n    \"1-2\": \"The number to display as the badge of the app icon.\\nIf this property is absent, the badge is not changed. To remove the badge, set the value of this property to `0`.\",\n    \"2-2\": \"The key to a title string in the `Localizable.strings` file for the current localization. The key string can be formatted with `%@` and `%n$@` specifiers to take the variables specified in the `alert.ios.titleLocArgs` array. See [Localized Formatted Strings](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW7) for more information.\\nThis key was added in iOS 8.2.\",\n    \"3-2\": \"Variable string values to appear in place of the format specifiers in `alert.ios.titleLocKey`. See [Localized Formatted Strings](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW7) for more information.\\nThis key was added in iOS 8.2.\",\n    \"4-2\": \"The text of the alert message.\\nThis field is just like `alert.text`, but presented with the iOS specific name for convenience.\",\n    \"5-2\": \"A key to an alert-message string in a `Localizable.strings` file for the current localization (which is set by the user’s language preference). The key string can be formatted with `%@` and `%n$@` specifiers to take the variables specified in the `alert.ios.locArgs` array. See [Localized Formatted Strings](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW7) for more information.\",\n    \"6-2\": \"Variable string values to appear in place of the format specifiers in `alert.ios.locKey`. See [Localized Formatted Strings](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW7) for more information.\",\n    \"7-2\": \"If a string is specified, the system displays an alert that includes the Close and View buttons. The string is used as a key to get a localized string in the current localization to use for the right button’s title instead of “View”. See [Localized Formatted Strings](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW7) for more information.\",\n    \"8-2\": \"The filename of an image file in the app bundle, with or without the filename extension. The image is used as the launch image when users tap the action button or move the action slider. If this property is not specified, the system either uses the previous snapshot,uses the image identified by the `UILaunchImageFile` key in the app’s `Info.plist` file, or falls back to `Default.png`.\\nThis property was added in iOS 4.0.\",\n    \"9-2\": \"Provide this key with a string value that represents the `identifier` property of the [`UIMutableUserNotificationCategory`](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIMutableUserNotificationCategory_class/index.html#//apple_ref/occ/cl/UIMutableUserNotificationCategory) object you created to define custom actions. To learn more about using custom actions, see [Registering Your Actionable Notification Types](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW26).\",\n    \"15-2\": \"Provide this key with a value of `1` to indicate that new content is available. Including this key and value means that when your app is launched in the background or resumed, `application:didReceiveRemoteNotification:fetchCompletionHandler:` is called.\\nNote that WonderPush sets this to `1` by default for internal bookkeeping purposes, but you can override this if necessary.\",\n    \"0-2\": \"The name of a sound file in the app bundle or in the `Library/Sounds` folder of the app’s data container. The sound in this file is played as an alert. If the sound file doesn’t exist or `default` is specified as the value, the default alert sound is played. The audio must be in one of the audio data formats that are compatible with system sounds; see [Preparing Custom Alert Sounds](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW6) for details.\",\n    \"16-0\": \"alert.ios.mutableContent\",\n    \"16-1\": \"integer\",\n    \"16-2\": \"Provide this key with a value of `1` to indicate that the Notification Service Extension can run and modify the notification. Necessary for media attachments.\\nNote that WonderPush sets this to `1` by default in order to support media attachments, but you can override this if necessary.\",\n    \"17-0\": \"alert.ios.foreground\",\n    \"17-1\": \"object\",\n    \"17-2\": \"Permits to customize some behavior if the notification is to be displayed while the application is foreground.\",\n    \"18-0\": \"alert.ios.foreground.autoOpen\",\n    \"18-1\": \"boolean\",\n    \"18-2\": \"Whether to automatically do as if the user clicked the notification if received while in foreground.\",\n    \"19-0\": \"alert.ios.foreground.autoDrop\",\n    \"19-1\": \"boolean\",\n    \"19-2\": \"Whether to automatically do as if the user swiped the notification if received while in foreground.\",\n    \"10-0\": \"alert.ios.attachments\",\n    \"10-1\": \"array of objects\",\n    \"10-2\": \"A list of media attachments to add to the notification. iOS 10 only shows the first one but you may use the others in you have your own Notification Content Extension. Requires at least SDK v1.2.2.0.\",\n    \"11-0\": \"alert.ios.attachments[].id\",\n    \"11-1\": \"string\",\n    \"11-2\": \"An optional identifier for use in your own Notification Content Extension if you have one.\",\n    \"12-0\": \"alert.ios.attachments[].url\",\n    \"12-1\": \"string\",\n    \"12-2\": \"The URL to the media to download and attach to the notification.\\nSee the [following documentation](https://developer.apple.com/reference/usernotifications/unnotificationattachment#1682051) for supported file formats and associated file size limits.\",\n    \"13-0\": \"alert.ios.attachments[].type\",\n    \"13-1\": \"string\",\n    \"13-2\": \"The type of the file that `.url` points to. Necessary if the URL does not end with a proper file extension.\\nValid official iOS values are: `public.png`, `public.jpeg`, `com.compuserve.gif`, `com.microsoft.waveform-audio`, `public.aiff-audio`, `public.mp3`, `public.mpeg-4-audio`, `public.mpeg`, `public.mpeg-2-video`, `public.mpeg-4`, `public.avi`.\\nValid file-extension-like values are: `png`, `jpg`, `jpeg`, `gif`, `wav`, `wave`, `aiff`, `mp3`, `m4a`, `mp4a`, `mpg`, `mpeg`, `mp2`, `m2v`, `mp4`, `avi`.\\nValid mime-type-like values are: `image/png`, `image/x-png`, `image/jpeg`, `image/gif`, `audio/wav`, `audio/x-wav`, `audio/aiff`, `audio/x-aiff`, `audio/mpeg`, `audio/mp3`, `audio/mpeg3`, `audio/mp4`, `video/mpeg`, `video/x-mpeg1`, `video/mpeg2`, `video/x-mpeg2`, `video/mp4`, `video/mpeg4`, `video/avi`.\",\n    \"14-0\": \"alert.ios.attachments[].options\",\n    \"14-1\": \"object\",\n    \"14-2\": \"Optional list of additional raw options to pass to the [notification attachment constructor method](https://developer.apple.com/reference/usernotifications/unnotificationattachment/1649987-init).\"\n  },\n  \"cols\": 3,\n  \"rows\": 20\n}\n[/block]\nYou can read more about those fields in the Apple documentation about [The Remote Notification Payload](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html).\n\nIf neither `alert.ios.foreground.autoOpen` nor `alert.ios.foreground.autoDrop` are set, the SDK presents the notification. On iOS 10, if you properly integrated the SDK v1.2.2.0 or later the OS itself will present the notification. On prior versions of iOS or if the your code does not call `[WonderPush setupDelegateForUserNotificationCenter]` on initialization, the SDK will present an alert with the notification title and text.\n\n----\n\nThe following table presents the Android specific options that can be user in the `alert.android` field:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"alert.android.channel\",\n    \"0-1\": \"string\",\n    \"2-0\": \"alert.android.bigTitle\",\n    \"3-0\": \"alert.android.bigText\",\n    \"4-0\": \"alert.android.summaryText\",\n    \"5-0\": \"alert.android.bigLargeIcon\",\n    \"6-0\": \"alert.android.bigPicture\",\n    \"7-0\": \"alert.android.lines\",\n    \"2-1\": \"string or HTML\\nValid for: `bigText`, `bigPicture` and `inbox`.\",\n    \"3-1\": \"string or HTML\\nValid for: `bigText`.\",\n    \"4-1\": \"string or HTML\\nValid for: `bigText`, `bigPicture` and `inbox`.\",\n    \"5-1\": \"URL or resource name\\nValid for: `bigPicture`.\",\n    \"6-1\": \"URL\\nValid for: `bigPicture`.\",\n    \"7-1\": \"array of strings or HTML\\nValid for: `inbox`.\",\n    \"0-2\": \"The Android O notification channel to post the notification to. Prior to Android O, the WonderPush SDK can associate user preferences just about the same way.\\nThe notification uses the default channel configured in the SDK if no value is provided.\",\n    \"2-2\": \"An alternate title when the notification is expanded.\",\n    \"3-2\": \"An alternate content when the notification is expanded.\",\n    \"4-2\": \"A last line of text to show under a horizontal ruler.\",\n    \"5-2\": \"An alternate large icon to show then the notification is expanded.\",\n    \"6-2\": \"A large picture to display when the notification is expanded.\",\n    \"7-2\": \"A list of single line sentences to show when the notification is expanded.\",\n    \"8-0\": \"alert.android.html\",\n    \"9-0\": \"alert.android.title\",\n    \"10-0\": \"alert.android.text\",\n    \"11-0\": \"alert.android.subText\",\n    \"12-0\": \"alert.android.info\",\n    \"13-0\": \"alert.android.ticker\",\n    \"14-0\": \"alert.android.tag\",\n    \"15-0\": \"alert.android.priority\",\n    \"16-0\": \"alert.android.persons\",\n    \"17-0\": \"alert.android.category\",\n    \"18-0\": \"alert.android.color\",\n    \"19-0\": \"alert.android.group\",\n    \"20-0\": \"alert.android.sortKey\",\n    \"21-0\": \"alert.android.localOnly\",\n    \"22-0\": \"alert.android.number\",\n    \"23-0\": \"alert.android.onlyAlertOnce\",\n    \"24-0\": \"alert.android.when\",\n    \"25-0\": \"alert.android.showWhen\",\n    \"26-0\": \"alert.android.usesChronometer\",\n    \"27-0\": \"alert.android.visibility\",\n    \"28-0\": \"alert.android.lights\",\n    \"32-0\": \"alert.android.vibrate\",\n    \"33-0\": \"alert.android.sound\",\n    \"34-0\": \"alert.android.ongoing\",\n    \"35-0\": \"alert.android.progress\",\n    \"36-0\": \"alert.android.smallIcon\",\n    \"37-0\": \"alert.android.largeIcon\",\n    \"38-0\": \"alert.android.buttons\",\n    \"39-0\": \"alert.android.buttons[].label\",\n    \"40-0\": \"alert.android.buttons[].icon\",\n    \"41-0\": \"alert.android.buttons[].targetUrl\",\n    \"42-0\": \"alert.android.buttons[].actions\",\n    \"43-0\": \"alert.android.foreground\",\n    \"44-0\": \"alert.android.foreground.priority\",\n    \"45-0\": \"alert.android.foreground.autoOpen\",\n    \"46-0\": \"alert.android.foreground.autoDrop\",\n    \"8-1\": \"boolean\",\n    \"18-2\": \"One of the [Color constants](https://developer.android.com/reference/android/graphics/Color.html), or an `#RRGGBB` color code.\",\n    \"8-2\": \"Whether to treat every displayable string in this object as being HTML styled.\\nOnly simple HTML styling tags are supported by Android\",\n    \"9-1\": \"string or HTML\",\n    \"10-1\": \"string or HTML\",\n    \"11-1\": \"string or HTML\",\n    \"12-1\": \"string or HTML\",\n    \"13-1\": \"string or HTML\",\n    \"14-1\": \"string, `null` or missing\",\n    \"15-2\": \"One of:\\n\\n* `max`\\n* `high`\\n* `default`\\n* `low`\\n* `min`\",\n    \"15-1\": \"string\",\n    \"16-1\": \"array of URIs\",\n    \"17-1\": \"string\",\n    \"17-2\": \"One of the [Notification category constants](https://developer.android.com/reference/android/app/Notification.html#constants), like `message`, `promo` or `reminder`.\",\n    \"18-1\": \"string\",\n    \"19-1\": \"string\",\n    \"20-1\": \"string\",\n    \"21-1\": \"boolean\",\n    \"23-1\": \"boolean\",\n    \"25-1\": \"boolean\",\n    \"26-1\": \"boolean\",\n    \"34-1\": \"boolean\",\n    \"45-1\": \"boolean\",\n    \"46-1\": \"boolean\",\n    \"19-2\": \"Set this notification to be part of a group of notifications sharing the same key. Grouped notifications may display in a cluster or stack on devices which support such rendering.\",\n    \"16-2\": \"Add a person that is relevant to this notification. The system will also attempt to resolve `mailto:` and `tel:` schema URIs.\",\n    \"37-2\": \"Add a large icon to the notification content view. In the platform template, this image will be shown on the left of the notification view in place of the small icon (which will be placed in a small badge atop the large icon).\",\n    \"37-1\": \"URL or resource identifier\",\n    \"29-0\": \"alert.android.lights.color\",\n    \"30-0\": \"alert.android.lights.on\",\n    \"31-0\": \"alert.android.lights.off\",\n    \"28-1\": \"boolean or object\",\n    \"28-2\": \"Set the desired color for the indicator LED on the device, as well as the blink duty cycle (specified in milliseconds). Not all devices will honor all (or even any) of these values.\\nUse `false to deactivate`, `true` to user the default values, an object to override some values.\",\n    \"29-2\": \"The LED color.\",\n    \"30-2\": \"How long should the LED stay on.\",\n    \"31-2\": \"How long should the LED stay off.\",\n    \"29-1\": \"string\",\n    \"30-1\": \"number of milliseconds\",\n    \"31-1\": \"number of milliseconds\",\n    \"32-1\": \"boolean or array of integers\",\n    \"32-2\": \"Should the notification vibrate using the default pattern, or the provided one.\",\n    \"33-1\": \"URL or resource identifier\",\n    \"33-2\": \"Set the sound to play. It will be played using the default audio attributes for notifications.\\nA notification that is noisy is more likely to be presented as a heads-up notification.\",\n    \"21-2\": \"Set whether or not this notification should not bridge to other devices.\\nSome notifications can be bridged to other devices for remote display. This hint can be set to recommend this notification not be bridged.\",\n    \"22-1\": \"integer\",\n    \"22-2\": \"Set the large number at the right-hand side of the notification. This is equivalent to `alert.android.info`, although it might show the number in a different font size for readability.\",\n    \"34-2\": \"Set whether this is an \\\"ongoing\\\" notification. Ongoing notifications cannot be dismissed by the user.\",\n    \"23-2\": \"Set this flag if you would only like the sound, vibrate and ticker to be played if the notification is not already showing.\",\n    \"35-2\": \"Set the progress this notification represents. The platform template will represent this using a progress bar.\\nUse `true` to set an undetermined state, or a number from 0 to 100 to set the corresponding percent completion to display.\",\n    \"35-1\": \"boolean or 0 to 100 integer\",\n    \"25-2\": \"Control whether the timestamp set with `alert.android.when` is shown in the content view. For apps targeting N and above, this defaults to false. For earlier apps, the default is true.\",\n    \"36-1\": \"resource identifier\",\n    \"36-2\": \"Set the small icon resource, which will be used to represent the notification in the status bar. The platform template for the expanded view will draw this icon in the left, unless a large icon has also been specified, in which case the small icon will be moved to the right-hand side.\",\n    \"20-2\": \"Set a sort key that orders this notification among other notifications from the same package. This can be useful if an external sort was already applied and an app would like to preserve this. Notifications will be sorted lexicographically using this value, although providing different priorities in addition to providing sort key may cause this value to be ignored.\",\n    \"13-2\": \"Set the \\\"ticker\\\" text which is sent to accessibility services.\",\n    \"26-2\": \"Show the when field as a stopwatch. Instead of presenting when as a timestamp, the notification will show an automatically updating display of the minutes and seconds since `alert.android.when`. Useful when showing an elapsed time (like an ongoing phone call). The counter can also be set to count down to `alert.android.when` when using setChronometerCountDown(boolean).\",\n    \"27-2\": \"One of:\\n\\n* `private` (the default)\\n* `secret`\\n* `public`\",\n    \"27-1\": \"string\",\n    \"24-1\": \"timestamp in milliseconds\",\n    \"24-2\": \"Add a timestamp pertaining to the notification (usually the time the event occurred). For apps targeting N and above, this time is not shown anymore by default and must be opted into by using `alert.android.showWhen`.\",\n    \"12-2\": \"A small piece of additional information pertaining to this notification. The platform template will draw this on the last line of the notification, at the far right (to the right of a smallIcon if it has been placed there).\",\n    \"10-2\": \"Set the second line of text in the platform notification template.\",\n    \"9-2\": \"Set the first line of text in the platform notification template.\",\n    \"11-2\": \"This provides some additional information that is displayed in the notification.\",\n    \"14-2\": \"If a notification using the same tag is currently displayed, it will be updated, otherwise, a new notification is shown.\",\n    \"38-1\": \"array of objects\",\n    \"38-2\": \"A list of up to 3 buttons to add to the notification in the notification center.\",\n    \"39-1\": \"string\",\n    \"39-2\": \"The button label.\",\n    \"40-1\": \"resource identifier\",\n    \"40-2\": \"The icon to display next to the button label.\",\n    \"41-1\": \"URL\",\n    \"41-2\": \"The content to open when clicking on the button, as an alternative to clicking on the notification itself.\",\n    \"42-1\": \"array of objects\",\n    \"42-2\": \"A list of background options to perform when clicking on the button.\",\n    \"43-1\": \"object\",\n    \"43-2\": \"Permits to override any of the above options if the notification is displayed while the application is foreground.\",\n    \"44-1\": \"string\",\n    \"44-2\": \"See `alert.android.priority`.\\nDefaults to `high` in order to get the notification presented as heads-up by the system above your application.\",\n    \"45-2\": \"Whether to automatically do as if the user clicked the notification if received while in foreground.\",\n    \"46-2\": \"Whether to automatically do as if the user swiped the notification if received while in foreground.\",\n    \"1-0\": \"alert.android.type\",\n    \"1-1\": \"string\",\n    \"1-2\": \"One of:\\n\\n* missing, or `null`: Default style, with expandable text.\\n* `none`: No style, the text will be shown on a single line.\\n* `bigText`: In the big text style, the expanded and collapsed state can show a different content.\\n* `bigPicture`: The big picture style can display a large picture below a line of text.\\n* `inbox`: Displays multiple sentences when expanded, each on a single line.\"\n  },\n  \"cols\": 3,\n  \"rows\": 47\n}\n[/block]\nHTML styling support is limited to *about* the following tags:\n\n* `<br>`\n* `<h1>` `<h2>` `<h3>` `<h4>` `<h5>` `<h6>`\n* `<b>` `<i>` `<u>` `<big>` `<small>` `<strong>` `<em>` `<strike>` `<sub>` `<sup>`\n* `<a href=\"http://www.example.com\">Link</a>`\n* `<img src=\"http://www.example.com/image.png\"></img>`\n* `<div align=\"left|center|right\">`\n* `<p dir=\"ltr|rtl\">`\n* `<font size=\"24\" color=\"red\" face=\"Monospace\">` `<tt>`\n* `<blockquote>` `<cite>` `<dfn>`\n\n----\n\nThe following table presents the Web specific options that can be user in the `alert.web` field:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"alert.web.dir\",\n    \"1-0\": \"alert.web.lang\",\n    \"2-0\": \"alert.web.body\",\n    \"3-0\": \"alert.web.tag\",\n    \"4-0\": \"alert.web.icon\",\n    \"5-0\": \"alert.web.badge\",\n    \"7-0\": \"alert.web.sound\",\n    \"8-0\": \"alert.web.vibrate\",\n    \"9-0\": \"alert.web.timestamp\",\n    \"10-0\": \"alert.web.renotify\",\n    \"11-0\": \"alert.web.silent\",\n    \"12-0\": \"alert.web.noscreen\",\n    \"13-0\": \"alert.web.requireInteraction\",\n    \"14-0\": \"alert.web.sticky\",\n    \"15-0\": \"alert.web.buttons\",\n    \"0-1\": \"string\",\n    \"1-1\": \"string\",\n    \"2-1\": \"string\",\n    \"3-1\": \"string\",\n    \"4-1\": \"URL\",\n    \"5-1\": \"URL\",\n    \"7-1\": \"URL\",\n    \"10-1\": \"boolean\",\n    \"11-1\": \"boolean\",\n    \"12-1\": \"boolean\",\n    \"13-1\": \"boolean\",\n    \"14-1\": \"boolean\",\n    \"0-2\": \"`auto`, `ltr` or `rtl`. How the text should be aligned. Helps supporting right-to-left languages.\",\n    \"1-2\": \"The notification’s language specifies the primary language for the notification’s title, body and the title of each of its buttons. Its value is a string. The empty string indicates that the primary language is unknown. Any other string must be interpreted as a language tag. Validity or well-formedness are not enforced.\",\n    \"2-2\": \"Text text to display in the notification. This is the Web specific name of the `alert.text` field.\",\n    \"3-2\": \"Notifications with same tag can be replaced, or updated, by this one.\",\n    \"4-2\": \"The HTTPS URL of the icon to display next to the notification.\\n*Must use HTTPS.*\",\n    \"5-2\": \"A small icon displayed when there is not enough space to display the notification itself. It may also be displayed inside the notification with less visual priority than the icon itself.\",\n    \"11-2\": \"Indicates that no sounds or vibrations should be made.\",\n    \"13-2\": \"Indicates that on devices with a sufficiently large screen, the notification should remain readily available until the user activates or dismisses the notification.\\nWonderPush sets this by default in order to prevent some browsers from automatically dismissing the notification after a few seconds.\",\n    \"14-2\": \"Indicates that the end user should not be able to easily clear the notification.\",\n    \"9-1\": \"timestamp in milliseconds\",\n    \"9-2\": \"Indicates the time of the event for which the notification is shown.\",\n    \"10-2\": \"Indicates if the user should get a visual notification after a notification has been updated.\",\n    \"8-1\": \"array of integer\",\n    \"8-2\": \"The vibration pattern.\",\n    \"7-2\": \"The sound to play.\",\n    \"12-2\": \"Indicates that the screen of the device should not be enabled.\",\n    \"15-1\": \"array of objects\",\n    \"15-2\": \"A list of buttons to add to the notification.\\nNote: The Notification API specification uses the name `actions` for that.\",\n    \"16-0\": \"alert.web.buttons[].label\",\n    \"18-0\": \"alert.web.buttons[].icon\",\n    \"19-0\": \"alert.web.buttons[].targetUrl\",\n    \"20-0\": \"alert.web.buttons[].actions\",\n    \"17-0\": \"alert.web.buttons[].action\",\n    \"16-1\": \"string\",\n    \"17-1\": \"string\",\n    \"18-1\": \"URL\",\n    \"19-1\": \"URL\",\n    \"20-1\": \"array of objects\",\n    \"16-2\": \"The notification button label.\",\n    \"17-2\": \"The notification button identifier. An identifier is automatically generated if not specified.\",\n    \"18-2\": \"A small button icon to display next to the button label.\",\n    \"19-2\": \"The URL of the page to show when clicking on that button, as an alternative to clicking on the notification itself.\",\n    \"20-2\": \"The optional list of actions that the button should perform.\",\n    \"6-0\": \"alert.web.image\",\n    \"6-1\": \"URL\",\n    \"6-2\": \"The HTTPS URL of the big image to display below to the notification.\\n*Must use HTTPS.*\"\n  },\n  \"cols\": 3,\n  \"rows\": 21\n}\n[/block]\nFor more information, you can read the [Notification API](https://notifications.spec.whatwg.org/) living standard, but beware, it's a bit dry.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"In-app components\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field\",\n    \"h-1\": \"Valid for\",\n    \"h-2\": \"Type\",\n    \"h-3\": \"Description\",\n    \"0-0\": \"inApp.type\",\n    \"0-1\": \"All\",\n    \"0-2\": \"string\",\n    \"1-0\": \"inApp.title\",\n    \"2-0\": \"inApp.message\",\n    \"3-0\": \"inApp.url\",\n    \"4-0\": \"inApp.buttons\",\n    \"1-3\": \"The optional title of the in-app dialog box.\",\n    \"1-2\": \"string\",\n    \"2-2\": \"string\",\n    \"3-2\": \"a URL\",\n    \"4-2\": \"array of objects\",\n    \"2-3\": \"The content of the in-app dialog box.\\n\\nFor a `text` in-app, no formatting is performed, but new lines are preserved.\\n\\nFor `html` in-app, contains the HTML code to be rendered.\",\n    \"0-3\": \"One of the supported notification types:\\n\\n* `text`: Displays a text message\\n* `html`: Displays an inline HTML message\\n* `url`: Displays the content of the given web page\",\n    \"3-3\": \"The URL of the web page to render.\",\n    \"3-1\": \"`url`\",\n    \"1-1\": \"All\",\n    \"2-1\": \"`text`, `html`\",\n    \"4-1\": \"All\",\n    \"5-0\": \"inApp.buttons[].label\",\n    \"6-0\": \"inApp.buttons[].actions\",\n    \"5-1\": \"All\",\n    \"6-1\": \"All\",\n    \"5-2\": \"string\",\n    \"6-2\": \"array of objects\",\n    \"4-3\": \"An optional list of up to 3 buttons to show in the in-app dialog box.\\nIf you specify no button, the SDKs will automatically add a single *Close* button.\",\n    \"5-3\": \"The label of a button.\",\n    \"6-3\": \"The optional list of actions that the button should perform.\\n`close` is always an implicit action.\"\n  },\n  \"cols\": 4,\n  \"rows\": 7\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Push options\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"push.payload\",\n    \"0-1\": \"object\",\n    \"1-0\": \"push.custom\",\n    \"1-1\": \"object\",\n    \"2-0\": \"push.expirationDate\",\n    \"2-1\": \"timestamp in milliseconds, or a string date using format `YYYY-MM-DDTHH:MM:SS.MMM+HH:MM`\",\n    \"4-0\": \"push.priority\",\n    \"4-1\": \"string\",\n    \"4-2\": \"`normal` or `high`\",\n    \"5-0\": \"push.android\",\n    \"9-0\": \"push.ios\",\n    \"10-0\": \"push.web\",\n    \"5-1\": \"object\",\n    \"9-1\": \"object\",\n    \"10-1\": \"object\",\n    \"1-2\": \"A key value mapping of custom data to give in the notification payload under the `custom` key.\",\n    \"0-2\": \"Custom payload to merge with the notification payload itself.\\nOn the contrary to the `custom` argument, this enabled you to control the whole notification payload.\\nBe careful when writing into the `_wp` field (reserved for the WonderPush SDK) or `aps` field (reserved for Apple notifications).\",\n    \"2-2\": \"The date after which the notification should be dropped if not already delivered to a user's device.\\nUse 0 to try only once.\",\n    \"5-2\": \"You can override any of the above keys for Android devices.\\nThe following subkeys allow you to further control some Android-specific options.\",\n    \"10-2\": \"You can override any of the above keys for Web devices.\",\n    \"9-2\": \"You can override any of the above keys for iOS devices.\",\n    \"6-0\": \"push.android.delayWhenIdle\",\n    \"6-1\": \"boolean\",\n    \"7-0\": \"push.android.collapseKey\",\n    \"8-0\": \"push.android.restrictedPackageName\",\n    \"8-1\": \"string\",\n    \"7-1\": \"string\",\n    \"6-2\": \"Indicates whether the message should not be sent until the device becomes active.\",\n    \"7-2\": \"This parameter defines a group of messages that can be collapsed, so that only the last message gets sent when notifications can be delivered to a device anew.\",\n    \"8-2\": \"This parameter specifies the package name of the application where the registration tokens must match in order to receive the message.\",\n    \"3-0\": \"push.expirationTime\",\n    \"3-1\": \"duration in milliseconds, or something like \\\"10 minutes\\\"\",\n    \"3-2\": \"The duration after which the notification should be dropped if not already delivered to a user's device.\\nUse 0 to try only once.\"\n  },\n  \"cols\": 3,\n  \"rows\": 11\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Available `actions` for notification clicks and buttons\"\n}\n[/block]\nEach action is composed of a `type` field, and any additional fields required by the chosen type.\nWe present below one table per supported action type.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field\",\n    \"h-1\": \"Valid for\",\n    \"h-2\": \"Type\",\n    \"h-3\": \"Description\",\n    \"0-0\": \".type\",\n    \"1-0\": \".event\",\n    \"2-0\": \".event.type\",\n    \"3-0\": \".event.custom\",\n    \"4-0\": \".custom\",\n    \"5-0\": \".method\",\n    \"6-0\": \".methodArgs\",\n    \"7-0\": \".url\",\n    \"0-1\": \"All\",\n    \"1-1\": \"`trackEvent`\",\n    \"2-1\": \"`trackEvent`\",\n    \"3-1\": \"`trackEvent`\",\n    \"4-1\": \"`updateInstallation`\",\n    \"5-1\": \"`method`\",\n    \"6-1\": \"`method`\",\n    \"7-1\": \"`link`\",\n    \"0-2\": \"string\",\n    \"1-2\": \"object\",\n    \"2-2\": \"string\",\n    \"3-2\": \"object\",\n    \"4-2\": \"object\",\n    \"5-2\": \"string\",\n    \"6-2\": \"string\",\n    \"7-2\": \"string\",\n    \"1-3\": \"The event that should be tracked.\",\n    \"2-3\": \"The event type, like the first argument of the `trackEvent()` method of the SDK.\",\n    \"3-3\": \"Optional custom data to attach to the event payload.\\nSee the [accepted format](http://www.wonderpush.com/docs/guide/custom-fields).\",\n    \"4-3\": \"Custom data to set in the installation custom data.\\nAny new field will be created, and any existing field will be overwritten.\\nSee the [accepted format](http://www.wonderpush.com/docs/guide/custom-fields).\",\n    \"5-3\": \"The callback method name.\",\n    \"6-3\": \"The callback argument value.\",\n    \"7-3\": \"The URL or deeplink to open.\",\n    \"0-3\": \"* `\\\"close\\\"`: Simply closes the in-app dialog box.\\n  If not given explicitly, this action is always added implicitly.\\n\\n* `\\\"trackEvent\\\"`: Tracks a user event.\\n  This has the same effect as if you had called the `trackEvent()` method of the SDK manually, only you control it dynamically using push notifications.\\n\\n* `\\\"updateInstallation\\\"`: Modify the installation custom properties.\\n  This has the same effect as if you had called the `putInstallationCustomProperties()` method of the SDK manually, only you control it dynamically using push notifications.\\n\\n* `\\\"method\\\"`: Automatically triggers a registered callback.\\n  Take a look at the demo applications source code on GitHub to see how you can listen to those callbacks.\\n\\n* `\\\"link\\\"`: Opens the given URL in the browser, or using any application that is bond with it in the system.\\n\\n* `\\\"rating\\\"`: Opens the application store of device platform, on the page corresponding to your application.\"\n  },\n  \"cols\": 4,\n  \"rows\": 8\n}\n[/block]","githubsync":"","next":{"description":"","pages":[]},"title":"Notification","type":"basic","__v":38,"category":"5763c690e3e44d0e000a4d41","createdAt":"2016-06-17T09:53:25.062Z","hidden":false,"isReference":true,"link_external":false,"project":"5626303ed0f87e190014c548","version":"5626303fd0f87e190014c54b","link_url":"","slug":"notification","updates":[],"user":"56262ffad0f87e190014c547","childrenPages":[]}

Notification

Simple, silent, rich, with an in-app… One object to represent them all.

This objects represents what the user will see. It is split into 3 main fields: `alert`, `inApp` and `push`. The first one controls what the user will see in the notification center, the second one controls an optional message to show on top of your application once the notification is clicked, and the last one controls various payload and push options. The simplest form of notification you can create contains only a text alert: [block:code] { "codes": [ { "code": "{\"alert\":{\"text\": \"Hello, WonderPush!\"}}", "language": "json", "name": "Basic notification" } ] } [/block] [block:api-header] { "type": "basic", "title": "Alert" } [/block] [block:parameters] { "data": { "h-0": "Field", "h-1": "Type", "h-2": "Description", "0-0": "alert.text", "1-0": "alert.title", "2-0": "alert.targetUrl", "3-0": "alert.actions", "4-0": "alert.ios", "5-0": "alert.android", "6-0": "alert.web", "0-1": "string", "1-1": "string", "2-1": "a URL", "3-1": "array of objects", "4-1": "object", "5-1": "object", "6-1": "object", "0-2": "The message to display in the notification center.", "1-2": "The title of the notification to display in the notification center.", "2-2": "The content that should be displayed when the user clicks the notification.\n\n* missing, `null` or `wonderpush://notificationOpen/default`, the default.\n Simply shows the application.\n* any deeplink URL (eg.: `yourapp://targetScreen?someParams`)\n The OS of the user device will resolve this accordingly.\n* any HTTP URL (eg.: `https://www.yourwebsite.com/somePage?someTrackingInfo`)\n The OS of the user device will resolve this accordingly.\n It will point to your application if supported, or else will open the web browser.\n* `wonderpush://notificationOpen/broadcast`\n Lets application code decide what screen to launch.\n* `wonderpush://notificationOpen/noop`\n Performs no action. Use this for your notification buttons. Clicking the notification itself should always have some visible feedback so avoid this value.\n\nMore info on how to handle your own deeplinks: [Android](http://www.wonderpush.com/docs/android/getting-started#android-getting-started-advanced-usage-own-deep-links), [iOS](http://www.wonderpush.com/docs/ios/getting-started#ios-getting-started-advanced-usage-own-deep-links).", "3-2": "An optional list of background actions to perform when the user clicks the notification.", "4-2": "iOS specific options", "5-2": "Android specific options", "6-2": "Web specific options" }, "cols": 3, "rows": 7 } [/block] ---- The following table presents the iOS specific options that can be user in the `alert.ios` field: [block:parameters] { "data": { "h-0": "Field", "h-1": "Type", "h-2": "Description", "0-0": "alert.ios.sound", "0-1": "string", "3-0": "alert.ios.titleLocArgs", "4-0": "alert.ios.body", "5-0": "alert.ios.locKey", "6-0": "alert.ios.locArgs", "7-0": "alert.ios.actionLocKey", "8-0": "alert.ios.launchImage", "2-0": "alert.ios.titleLocKey", "1-0": "alert.ios.badge", "1-1": "integer", "9-0": "alert.ios.category", "15-0": "alert.ios.contentAvailable", "2-1": "string", "3-1": "array of string", "4-1": "string", "5-1": "string", "6-1": "array of string", "7-1": "string", "8-1": "string", "9-1": "string", "15-1": "integer", "1-2": "The number to display as the badge of the app icon.\nIf this property is absent, the badge is not changed. To remove the badge, set the value of this property to `0`.", "2-2": "The key to a title string in the `Localizable.strings` file for the current localization. The key string can be formatted with `%@` and `%n$@` specifiers to take the variables specified in the `alert.ios.titleLocArgs` array. See [Localized Formatted Strings](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW7) for more information.\nThis key was added in iOS 8.2.", "3-2": "Variable string values to appear in place of the format specifiers in `alert.ios.titleLocKey`. See [Localized Formatted Strings](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW7) for more information.\nThis key was added in iOS 8.2.", "4-2": "The text of the alert message.\nThis field is just like `alert.text`, but presented with the iOS specific name for convenience.", "5-2": "A key to an alert-message string in a `Localizable.strings` file for the current localization (which is set by the user’s language preference). The key string can be formatted with `%@` and `%n$@` specifiers to take the variables specified in the `alert.ios.locArgs` array. See [Localized Formatted Strings](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW7) for more information.", "6-2": "Variable string values to appear in place of the format specifiers in `alert.ios.locKey`. See [Localized Formatted Strings](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW7) for more information.", "7-2": "If a string is specified, the system displays an alert that includes the Close and View buttons. The string is used as a key to get a localized string in the current localization to use for the right button’s title instead of “View”. See [Localized Formatted Strings](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW7) for more information.", "8-2": "The filename of an image file in the app bundle, with or without the filename extension. The image is used as the launch image when users tap the action button or move the action slider. If this property is not specified, the system either uses the previous snapshot,uses the image identified by the `UILaunchImageFile` key in the app’s `Info.plist` file, or falls back to `Default.png`.\nThis property was added in iOS 4.0.", "9-2": "Provide this key with a string value that represents the `identifier` property of the [`UIMutableUserNotificationCategory`](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIMutableUserNotificationCategory_class/index.html#//apple_ref/occ/cl/UIMutableUserNotificationCategory) object you created to define custom actions. To learn more about using custom actions, see [Registering Your Actionable Notification Types](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW26).", "15-2": "Provide this key with a value of `1` to indicate that new content is available. Including this key and value means that when your app is launched in the background or resumed, `application:didReceiveRemoteNotification:fetchCompletionHandler:` is called.\nNote that WonderPush sets this to `1` by default for internal bookkeeping purposes, but you can override this if necessary.", "0-2": "The name of a sound file in the app bundle or in the `Library/Sounds` folder of the app’s data container. The sound in this file is played as an alert. If the sound file doesn’t exist or `default` is specified as the value, the default alert sound is played. The audio must be in one of the audio data formats that are compatible with system sounds; see [Preparing Custom Alert Sounds](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW6) for details.", "16-0": "alert.ios.mutableContent", "16-1": "integer", "16-2": "Provide this key with a value of `1` to indicate that the Notification Service Extension can run and modify the notification. Necessary for media attachments.\nNote that WonderPush sets this to `1` by default in order to support media attachments, but you can override this if necessary.", "17-0": "alert.ios.foreground", "17-1": "object", "17-2": "Permits to customize some behavior if the notification is to be displayed while the application is foreground.", "18-0": "alert.ios.foreground.autoOpen", "18-1": "boolean", "18-2": "Whether to automatically do as if the user clicked the notification if received while in foreground.", "19-0": "alert.ios.foreground.autoDrop", "19-1": "boolean", "19-2": "Whether to automatically do as if the user swiped the notification if received while in foreground.", "10-0": "alert.ios.attachments", "10-1": "array of objects", "10-2": "A list of media attachments to add to the notification. iOS 10 only shows the first one but you may use the others in you have your own Notification Content Extension. Requires at least SDK v1.2.2.0.", "11-0": "alert.ios.attachments[].id", "11-1": "string", "11-2": "An optional identifier for use in your own Notification Content Extension if you have one.", "12-0": "alert.ios.attachments[].url", "12-1": "string", "12-2": "The URL to the media to download and attach to the notification.\nSee the [following documentation](https://developer.apple.com/reference/usernotifications/unnotificationattachment#1682051) for supported file formats and associated file size limits.", "13-0": "alert.ios.attachments[].type", "13-1": "string", "13-2": "The type of the file that `.url` points to. Necessary if the URL does not end with a proper file extension.\nValid official iOS values are: `public.png`, `public.jpeg`, `com.compuserve.gif`, `com.microsoft.waveform-audio`, `public.aiff-audio`, `public.mp3`, `public.mpeg-4-audio`, `public.mpeg`, `public.mpeg-2-video`, `public.mpeg-4`, `public.avi`.\nValid file-extension-like values are: `png`, `jpg`, `jpeg`, `gif`, `wav`, `wave`, `aiff`, `mp3`, `m4a`, `mp4a`, `mpg`, `mpeg`, `mp2`, `m2v`, `mp4`, `avi`.\nValid mime-type-like values are: `image/png`, `image/x-png`, `image/jpeg`, `image/gif`, `audio/wav`, `audio/x-wav`, `audio/aiff`, `audio/x-aiff`, `audio/mpeg`, `audio/mp3`, `audio/mpeg3`, `audio/mp4`, `video/mpeg`, `video/x-mpeg1`, `video/mpeg2`, `video/x-mpeg2`, `video/mp4`, `video/mpeg4`, `video/avi`.", "14-0": "alert.ios.attachments[].options", "14-1": "object", "14-2": "Optional list of additional raw options to pass to the [notification attachment constructor method](https://developer.apple.com/reference/usernotifications/unnotificationattachment/1649987-init)." }, "cols": 3, "rows": 20 } [/block] You can read more about those fields in the Apple documentation about [The Remote Notification Payload](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html). If neither `alert.ios.foreground.autoOpen` nor `alert.ios.foreground.autoDrop` are set, the SDK presents the notification. On iOS 10, if you properly integrated the SDK v1.2.2.0 or later the OS itself will present the notification. On prior versions of iOS or if the your code does not call `[WonderPush setupDelegateForUserNotificationCenter]` on initialization, the SDK will present an alert with the notification title and text. ---- The following table presents the Android specific options that can be user in the `alert.android` field: [block:parameters] { "data": { "h-0": "Field", "h-1": "Type", "h-2": "Description", "0-0": "alert.android.channel", "0-1": "string", "2-0": "alert.android.bigTitle", "3-0": "alert.android.bigText", "4-0": "alert.android.summaryText", "5-0": "alert.android.bigLargeIcon", "6-0": "alert.android.bigPicture", "7-0": "alert.android.lines", "2-1": "string or HTML\nValid for: `bigText`, `bigPicture` and `inbox`.", "3-1": "string or HTML\nValid for: `bigText`.", "4-1": "string or HTML\nValid for: `bigText`, `bigPicture` and `inbox`.", "5-1": "URL or resource name\nValid for: `bigPicture`.", "6-1": "URL\nValid for: `bigPicture`.", "7-1": "array of strings or HTML\nValid for: `inbox`.", "0-2": "The Android O notification channel to post the notification to. Prior to Android O, the WonderPush SDK can associate user preferences just about the same way.\nThe notification uses the default channel configured in the SDK if no value is provided.", "2-2": "An alternate title when the notification is expanded.", "3-2": "An alternate content when the notification is expanded.", "4-2": "A last line of text to show under a horizontal ruler.", "5-2": "An alternate large icon to show then the notification is expanded.", "6-2": "A large picture to display when the notification is expanded.", "7-2": "A list of single line sentences to show when the notification is expanded.", "8-0": "alert.android.html", "9-0": "alert.android.title", "10-0": "alert.android.text", "11-0": "alert.android.subText", "12-0": "alert.android.info", "13-0": "alert.android.ticker", "14-0": "alert.android.tag", "15-0": "alert.android.priority", "16-0": "alert.android.persons", "17-0": "alert.android.category", "18-0": "alert.android.color", "19-0": "alert.android.group", "20-0": "alert.android.sortKey", "21-0": "alert.android.localOnly", "22-0": "alert.android.number", "23-0": "alert.android.onlyAlertOnce", "24-0": "alert.android.when", "25-0": "alert.android.showWhen", "26-0": "alert.android.usesChronometer", "27-0": "alert.android.visibility", "28-0": "alert.android.lights", "32-0": "alert.android.vibrate", "33-0": "alert.android.sound", "34-0": "alert.android.ongoing", "35-0": "alert.android.progress", "36-0": "alert.android.smallIcon", "37-0": "alert.android.largeIcon", "38-0": "alert.android.buttons", "39-0": "alert.android.buttons[].label", "40-0": "alert.android.buttons[].icon", "41-0": "alert.android.buttons[].targetUrl", "42-0": "alert.android.buttons[].actions", "43-0": "alert.android.foreground", "44-0": "alert.android.foreground.priority", "45-0": "alert.android.foreground.autoOpen", "46-0": "alert.android.foreground.autoDrop", "8-1": "boolean", "18-2": "One of the [Color constants](https://developer.android.com/reference/android/graphics/Color.html), or an `#RRGGBB` color code.", "8-2": "Whether to treat every displayable string in this object as being HTML styled.\nOnly simple HTML styling tags are supported by Android", "9-1": "string or HTML", "10-1": "string or HTML", "11-1": "string or HTML", "12-1": "string or HTML", "13-1": "string or HTML", "14-1": "string, `null` or missing", "15-2": "One of:\n\n* `max`\n* `high`\n* `default`\n* `low`\n* `min`", "15-1": "string", "16-1": "array of URIs", "17-1": "string", "17-2": "One of the [Notification category constants](https://developer.android.com/reference/android/app/Notification.html#constants), like `message`, `promo` or `reminder`.", "18-1": "string", "19-1": "string", "20-1": "string", "21-1": "boolean", "23-1": "boolean", "25-1": "boolean", "26-1": "boolean", "34-1": "boolean", "45-1": "boolean", "46-1": "boolean", "19-2": "Set this notification to be part of a group of notifications sharing the same key. Grouped notifications may display in a cluster or stack on devices which support such rendering.", "16-2": "Add a person that is relevant to this notification. The system will also attempt to resolve `mailto:` and `tel:` schema URIs.", "37-2": "Add a large icon to the notification content view. In the platform template, this image will be shown on the left of the notification view in place of the small icon (which will be placed in a small badge atop the large icon).", "37-1": "URL or resource identifier", "29-0": "alert.android.lights.color", "30-0": "alert.android.lights.on", "31-0": "alert.android.lights.off", "28-1": "boolean or object", "28-2": "Set the desired color for the indicator LED on the device, as well as the blink duty cycle (specified in milliseconds). Not all devices will honor all (or even any) of these values.\nUse `false to deactivate`, `true` to user the default values, an object to override some values.", "29-2": "The LED color.", "30-2": "How long should the LED stay on.", "31-2": "How long should the LED stay off.", "29-1": "string", "30-1": "number of milliseconds", "31-1": "number of milliseconds", "32-1": "boolean or array of integers", "32-2": "Should the notification vibrate using the default pattern, or the provided one.", "33-1": "URL or resource identifier", "33-2": "Set the sound to play. It will be played using the default audio attributes for notifications.\nA notification that is noisy is more likely to be presented as a heads-up notification.", "21-2": "Set whether or not this notification should not bridge to other devices.\nSome notifications can be bridged to other devices for remote display. This hint can be set to recommend this notification not be bridged.", "22-1": "integer", "22-2": "Set the large number at the right-hand side of the notification. This is equivalent to `alert.android.info`, although it might show the number in a different font size for readability.", "34-2": "Set whether this is an \"ongoing\" notification. Ongoing notifications cannot be dismissed by the user.", "23-2": "Set this flag if you would only like the sound, vibrate and ticker to be played if the notification is not already showing.", "35-2": "Set the progress this notification represents. The platform template will represent this using a progress bar.\nUse `true` to set an undetermined state, or a number from 0 to 100 to set the corresponding percent completion to display.", "35-1": "boolean or 0 to 100 integer", "25-2": "Control whether the timestamp set with `alert.android.when` is shown in the content view. For apps targeting N and above, this defaults to false. For earlier apps, the default is true.", "36-1": "resource identifier", "36-2": "Set the small icon resource, which will be used to represent the notification in the status bar. The platform template for the expanded view will draw this icon in the left, unless a large icon has also been specified, in which case the small icon will be moved to the right-hand side.", "20-2": "Set a sort key that orders this notification among other notifications from the same package. This can be useful if an external sort was already applied and an app would like to preserve this. Notifications will be sorted lexicographically using this value, although providing different priorities in addition to providing sort key may cause this value to be ignored.", "13-2": "Set the \"ticker\" text which is sent to accessibility services.", "26-2": "Show the when field as a stopwatch. Instead of presenting when as a timestamp, the notification will show an automatically updating display of the minutes and seconds since `alert.android.when`. Useful when showing an elapsed time (like an ongoing phone call). The counter can also be set to count down to `alert.android.when` when using setChronometerCountDown(boolean).", "27-2": "One of:\n\n* `private` (the default)\n* `secret`\n* `public`", "27-1": "string", "24-1": "timestamp in milliseconds", "24-2": "Add a timestamp pertaining to the notification (usually the time the event occurred). For apps targeting N and above, this time is not shown anymore by default and must be opted into by using `alert.android.showWhen`.", "12-2": "A small piece of additional information pertaining to this notification. The platform template will draw this on the last line of the notification, at the far right (to the right of a smallIcon if it has been placed there).", "10-2": "Set the second line of text in the platform notification template.", "9-2": "Set the first line of text in the platform notification template.", "11-2": "This provides some additional information that is displayed in the notification.", "14-2": "If a notification using the same tag is currently displayed, it will be updated, otherwise, a new notification is shown.", "38-1": "array of objects", "38-2": "A list of up to 3 buttons to add to the notification in the notification center.", "39-1": "string", "39-2": "The button label.", "40-1": "resource identifier", "40-2": "The icon to display next to the button label.", "41-1": "URL", "41-2": "The content to open when clicking on the button, as an alternative to clicking on the notification itself.", "42-1": "array of objects", "42-2": "A list of background options to perform when clicking on the button.", "43-1": "object", "43-2": "Permits to override any of the above options if the notification is displayed while the application is foreground.", "44-1": "string", "44-2": "See `alert.android.priority`.\nDefaults to `high` in order to get the notification presented as heads-up by the system above your application.", "45-2": "Whether to automatically do as if the user clicked the notification if received while in foreground.", "46-2": "Whether to automatically do as if the user swiped the notification if received while in foreground.", "1-0": "alert.android.type", "1-1": "string", "1-2": "One of:\n\n* missing, or `null`: Default style, with expandable text.\n* `none`: No style, the text will be shown on a single line.\n* `bigText`: In the big text style, the expanded and collapsed state can show a different content.\n* `bigPicture`: The big picture style can display a large picture below a line of text.\n* `inbox`: Displays multiple sentences when expanded, each on a single line." }, "cols": 3, "rows": 47 } [/block] HTML styling support is limited to *about* the following tags: * `<br>` * `<h1>` `<h2>` `<h3>` `<h4>` `<h5>` `<h6>` * `<b>` `<i>` `<u>` `<big>` `<small>` `<strong>` `<em>` `<strike>` `<sub>` `<sup>` * `<a href="http://www.example.com">Link</a>` * `<img src="http://www.example.com/image.png"></img>` * `<div align="left|center|right">` * `<p dir="ltr|rtl">` * `<font size="24" color="red" face="Monospace">` `<tt>` * `<blockquote>` `<cite>` `<dfn>` ---- The following table presents the Web specific options that can be user in the `alert.web` field: [block:parameters] { "data": { "h-0": "Field", "h-1": "Type", "h-2": "Description", "0-0": "alert.web.dir", "1-0": "alert.web.lang", "2-0": "alert.web.body", "3-0": "alert.web.tag", "4-0": "alert.web.icon", "5-0": "alert.web.badge", "7-0": "alert.web.sound", "8-0": "alert.web.vibrate", "9-0": "alert.web.timestamp", "10-0": "alert.web.renotify", "11-0": "alert.web.silent", "12-0": "alert.web.noscreen", "13-0": "alert.web.requireInteraction", "14-0": "alert.web.sticky", "15-0": "alert.web.buttons", "0-1": "string", "1-1": "string", "2-1": "string", "3-1": "string", "4-1": "URL", "5-1": "URL", "7-1": "URL", "10-1": "boolean", "11-1": "boolean", "12-1": "boolean", "13-1": "boolean", "14-1": "boolean", "0-2": "`auto`, `ltr` or `rtl`. How the text should be aligned. Helps supporting right-to-left languages.", "1-2": "The notification’s language specifies the primary language for the notification’s title, body and the title of each of its buttons. Its value is a string. The empty string indicates that the primary language is unknown. Any other string must be interpreted as a language tag. Validity or well-formedness are not enforced.", "2-2": "Text text to display in the notification. This is the Web specific name of the `alert.text` field.", "3-2": "Notifications with same tag can be replaced, or updated, by this one.", "4-2": "The HTTPS URL of the icon to display next to the notification.\n*Must use HTTPS.*", "5-2": "A small icon displayed when there is not enough space to display the notification itself. It may also be displayed inside the notification with less visual priority than the icon itself.", "11-2": "Indicates that no sounds or vibrations should be made.", "13-2": "Indicates that on devices with a sufficiently large screen, the notification should remain readily available until the user activates or dismisses the notification.\nWonderPush sets this by default in order to prevent some browsers from automatically dismissing the notification after a few seconds.", "14-2": "Indicates that the end user should not be able to easily clear the notification.", "9-1": "timestamp in milliseconds", "9-2": "Indicates the time of the event for which the notification is shown.", "10-2": "Indicates if the user should get a visual notification after a notification has been updated.", "8-1": "array of integer", "8-2": "The vibration pattern.", "7-2": "The sound to play.", "12-2": "Indicates that the screen of the device should not be enabled.", "15-1": "array of objects", "15-2": "A list of buttons to add to the notification.\nNote: The Notification API specification uses the name `actions` for that.", "16-0": "alert.web.buttons[].label", "18-0": "alert.web.buttons[].icon", "19-0": "alert.web.buttons[].targetUrl", "20-0": "alert.web.buttons[].actions", "17-0": "alert.web.buttons[].action", "16-1": "string", "17-1": "string", "18-1": "URL", "19-1": "URL", "20-1": "array of objects", "16-2": "The notification button label.", "17-2": "The notification button identifier. An identifier is automatically generated if not specified.", "18-2": "A small button icon to display next to the button label.", "19-2": "The URL of the page to show when clicking on that button, as an alternative to clicking on the notification itself.", "20-2": "The optional list of actions that the button should perform.", "6-0": "alert.web.image", "6-1": "URL", "6-2": "The HTTPS URL of the big image to display below to the notification.\n*Must use HTTPS.*" }, "cols": 3, "rows": 21 } [/block] For more information, you can read the [Notification API](https://notifications.spec.whatwg.org/) living standard, but beware, it's a bit dry. [block:api-header] { "type": "basic", "title": "In-app components" } [/block] [block:parameters] { "data": { "h-0": "Field", "h-1": "Valid for", "h-2": "Type", "h-3": "Description", "0-0": "inApp.type", "0-1": "All", "0-2": "string", "1-0": "inApp.title", "2-0": "inApp.message", "3-0": "inApp.url", "4-0": "inApp.buttons", "1-3": "The optional title of the in-app dialog box.", "1-2": "string", "2-2": "string", "3-2": "a URL", "4-2": "array of objects", "2-3": "The content of the in-app dialog box.\n\nFor a `text` in-app, no formatting is performed, but new lines are preserved.\n\nFor `html` in-app, contains the HTML code to be rendered.", "0-3": "One of the supported notification types:\n\n* `text`: Displays a text message\n* `html`: Displays an inline HTML message\n* `url`: Displays the content of the given web page", "3-3": "The URL of the web page to render.", "3-1": "`url`", "1-1": "All", "2-1": "`text`, `html`", "4-1": "All", "5-0": "inApp.buttons[].label", "6-0": "inApp.buttons[].actions", "5-1": "All", "6-1": "All", "5-2": "string", "6-2": "array of objects", "4-3": "An optional list of up to 3 buttons to show in the in-app dialog box.\nIf you specify no button, the SDKs will automatically add a single *Close* button.", "5-3": "The label of a button.", "6-3": "The optional list of actions that the button should perform.\n`close` is always an implicit action." }, "cols": 4, "rows": 7 } [/block] [block:api-header] { "type": "basic", "title": "Push options" } [/block] [block:parameters] { "data": { "h-0": "Field", "h-1": "Type", "h-2": "Description", "0-0": "push.payload", "0-1": "object", "1-0": "push.custom", "1-1": "object", "2-0": "push.expirationDate", "2-1": "timestamp in milliseconds, or a string date using format `YYYY-MM-DDTHH:MM:SS.MMM+HH:MM`", "4-0": "push.priority", "4-1": "string", "4-2": "`normal` or `high`", "5-0": "push.android", "9-0": "push.ios", "10-0": "push.web", "5-1": "object", "9-1": "object", "10-1": "object", "1-2": "A key value mapping of custom data to give in the notification payload under the `custom` key.", "0-2": "Custom payload to merge with the notification payload itself.\nOn the contrary to the `custom` argument, this enabled you to control the whole notification payload.\nBe careful when writing into the `_wp` field (reserved for the WonderPush SDK) or `aps` field (reserved for Apple notifications).", "2-2": "The date after which the notification should be dropped if not already delivered to a user's device.\nUse 0 to try only once.", "5-2": "You can override any of the above keys for Android devices.\nThe following subkeys allow you to further control some Android-specific options.", "10-2": "You can override any of the above keys for Web devices.", "9-2": "You can override any of the above keys for iOS devices.", "6-0": "push.android.delayWhenIdle", "6-1": "boolean", "7-0": "push.android.collapseKey", "8-0": "push.android.restrictedPackageName", "8-1": "string", "7-1": "string", "6-2": "Indicates whether the message should not be sent until the device becomes active.", "7-2": "This parameter defines a group of messages that can be collapsed, so that only the last message gets sent when notifications can be delivered to a device anew.", "8-2": "This parameter specifies the package name of the application where the registration tokens must match in order to receive the message.", "3-0": "push.expirationTime", "3-1": "duration in milliseconds, or something like \"10 minutes\"", "3-2": "The duration after which the notification should be dropped if not already delivered to a user's device.\nUse 0 to try only once." }, "cols": 3, "rows": 11 } [/block] [block:api-header] { "type": "basic", "title": "Available `actions` for notification clicks and buttons" } [/block] Each action is composed of a `type` field, and any additional fields required by the chosen type. We present below one table per supported action type. [block:parameters] { "data": { "h-0": "Field", "h-1": "Valid for", "h-2": "Type", "h-3": "Description", "0-0": ".type", "1-0": ".event", "2-0": ".event.type", "3-0": ".event.custom", "4-0": ".custom", "5-0": ".method", "6-0": ".methodArgs", "7-0": ".url", "0-1": "All", "1-1": "`trackEvent`", "2-1": "`trackEvent`", "3-1": "`trackEvent`", "4-1": "`updateInstallation`", "5-1": "`method`", "6-1": "`method`", "7-1": "`link`", "0-2": "string", "1-2": "object", "2-2": "string", "3-2": "object", "4-2": "object", "5-2": "string", "6-2": "string", "7-2": "string", "1-3": "The event that should be tracked.", "2-3": "The event type, like the first argument of the `trackEvent()` method of the SDK.", "3-3": "Optional custom data to attach to the event payload.\nSee the [accepted format](http://www.wonderpush.com/docs/guide/custom-fields).", "4-3": "Custom data to set in the installation custom data.\nAny new field will be created, and any existing field will be overwritten.\nSee the [accepted format](http://www.wonderpush.com/docs/guide/custom-fields).", "5-3": "The callback method name.", "6-3": "The callback argument value.", "7-3": "The URL or deeplink to open.", "0-3": "* `\"close\"`: Simply closes the in-app dialog box.\n If not given explicitly, this action is always added implicitly.\n\n* `\"trackEvent\"`: Tracks a user event.\n This has the same effect as if you had called the `trackEvent()` method of the SDK manually, only you control it dynamically using push notifications.\n\n* `\"updateInstallation\"`: Modify the installation custom properties.\n This has the same effect as if you had called the `putInstallationCustomProperties()` method of the SDK manually, only you control it dynamically using push notifications.\n\n* `\"method\"`: Automatically triggers a registered callback.\n Take a look at the demo applications source code on GitHub to see how you can listen to those callbacks.\n\n* `\"link\"`: Opens the given URL in the browser, or using any application that is bond with it in the system.\n\n* `\"rating\"`: Opens the application store of device platform, on the page corresponding to your application." }, "cols": 4, "rows": 8 } [/block]
This objects represents what the user will see. It is split into 3 main fields: `alert`, `inApp` and `push`. The first one controls what the user will see in the notification center, the second one controls an optional message to show on top of your application once the notification is clicked, and the last one controls various payload and push options. The simplest form of notification you can create contains only a text alert: [block:code] { "codes": [ { "code": "{\"alert\":{\"text\": \"Hello, WonderPush!\"}}", "language": "json", "name": "Basic notification" } ] } [/block] [block:api-header] { "type": "basic", "title": "Alert" } [/block] [block:parameters] { "data": { "h-0": "Field", "h-1": "Type", "h-2": "Description", "0-0": "alert.text", "1-0": "alert.title", "2-0": "alert.targetUrl", "3-0": "alert.actions", "4-0": "alert.ios", "5-0": "alert.android", "6-0": "alert.web", "0-1": "string", "1-1": "string", "2-1": "a URL", "3-1": "array of objects", "4-1": "object", "5-1": "object", "6-1": "object", "0-2": "The message to display in the notification center.", "1-2": "The title of the notification to display in the notification center.", "2-2": "The content that should be displayed when the user clicks the notification.\n\n* missing, `null` or `wonderpush://notificationOpen/default`, the default.\n Simply shows the application.\n* any deeplink URL (eg.: `yourapp://targetScreen?someParams`)\n The OS of the user device will resolve this accordingly.\n* any HTTP URL (eg.: `https://www.yourwebsite.com/somePage?someTrackingInfo`)\n The OS of the user device will resolve this accordingly.\n It will point to your application if supported, or else will open the web browser.\n* `wonderpush://notificationOpen/broadcast`\n Lets application code decide what screen to launch.\n* `wonderpush://notificationOpen/noop`\n Performs no action. Use this for your notification buttons. Clicking the notification itself should always have some visible feedback so avoid this value.\n\nMore info on how to handle your own deeplinks: [Android](http://www.wonderpush.com/docs/android/getting-started#android-getting-started-advanced-usage-own-deep-links), [iOS](http://www.wonderpush.com/docs/ios/getting-started#ios-getting-started-advanced-usage-own-deep-links).", "3-2": "An optional list of background actions to perform when the user clicks the notification.", "4-2": "iOS specific options", "5-2": "Android specific options", "6-2": "Web specific options" }, "cols": 3, "rows": 7 } [/block] ---- The following table presents the iOS specific options that can be user in the `alert.ios` field: [block:parameters] { "data": { "h-0": "Field", "h-1": "Type", "h-2": "Description", "0-0": "alert.ios.sound", "0-1": "string", "3-0": "alert.ios.titleLocArgs", "4-0": "alert.ios.body", "5-0": "alert.ios.locKey", "6-0": "alert.ios.locArgs", "7-0": "alert.ios.actionLocKey", "8-0": "alert.ios.launchImage", "2-0": "alert.ios.titleLocKey", "1-0": "alert.ios.badge", "1-1": "integer", "9-0": "alert.ios.category", "15-0": "alert.ios.contentAvailable", "2-1": "string", "3-1": "array of string", "4-1": "string", "5-1": "string", "6-1": "array of string", "7-1": "string", "8-1": "string", "9-1": "string", "15-1": "integer", "1-2": "The number to display as the badge of the app icon.\nIf this property is absent, the badge is not changed. To remove the badge, set the value of this property to `0`.", "2-2": "The key to a title string in the `Localizable.strings` file for the current localization. The key string can be formatted with `%@` and `%n$@` specifiers to take the variables specified in the `alert.ios.titleLocArgs` array. See [Localized Formatted Strings](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW7) for more information.\nThis key was added in iOS 8.2.", "3-2": "Variable string values to appear in place of the format specifiers in `alert.ios.titleLocKey`. See [Localized Formatted Strings](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW7) for more information.\nThis key was added in iOS 8.2.", "4-2": "The text of the alert message.\nThis field is just like `alert.text`, but presented with the iOS specific name for convenience.", "5-2": "A key to an alert-message string in a `Localizable.strings` file for the current localization (which is set by the user’s language preference). The key string can be formatted with `%@` and `%n$@` specifiers to take the variables specified in the `alert.ios.locArgs` array. See [Localized Formatted Strings](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW7) for more information.", "6-2": "Variable string values to appear in place of the format specifiers in `alert.ios.locKey`. See [Localized Formatted Strings](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW7) for more information.", "7-2": "If a string is specified, the system displays an alert that includes the Close and View buttons. The string is used as a key to get a localized string in the current localization to use for the right button’s title instead of “View”. See [Localized Formatted Strings](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW7) for more information.", "8-2": "The filename of an image file in the app bundle, with or without the filename extension. The image is used as the launch image when users tap the action button or move the action slider. If this property is not specified, the system either uses the previous snapshot,uses the image identified by the `UILaunchImageFile` key in the app’s `Info.plist` file, or falls back to `Default.png`.\nThis property was added in iOS 4.0.", "9-2": "Provide this key with a string value that represents the `identifier` property of the [`UIMutableUserNotificationCategory`](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIMutableUserNotificationCategory_class/index.html#//apple_ref/occ/cl/UIMutableUserNotificationCategory) object you created to define custom actions. To learn more about using custom actions, see [Registering Your Actionable Notification Types](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW26).", "15-2": "Provide this key with a value of `1` to indicate that new content is available. Including this key and value means that when your app is launched in the background or resumed, `application:didReceiveRemoteNotification:fetchCompletionHandler:` is called.\nNote that WonderPush sets this to `1` by default for internal bookkeeping purposes, but you can override this if necessary.", "0-2": "The name of a sound file in the app bundle or in the `Library/Sounds` folder of the app’s data container. The sound in this file is played as an alert. If the sound file doesn’t exist or `default` is specified as the value, the default alert sound is played. The audio must be in one of the audio data formats that are compatible with system sounds; see [Preparing Custom Alert Sounds](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW6) for details.", "16-0": "alert.ios.mutableContent", "16-1": "integer", "16-2": "Provide this key with a value of `1` to indicate that the Notification Service Extension can run and modify the notification. Necessary for media attachments.\nNote that WonderPush sets this to `1` by default in order to support media attachments, but you can override this if necessary.", "17-0": "alert.ios.foreground", "17-1": "object", "17-2": "Permits to customize some behavior if the notification is to be displayed while the application is foreground.", "18-0": "alert.ios.foreground.autoOpen", "18-1": "boolean", "18-2": "Whether to automatically do as if the user clicked the notification if received while in foreground.", "19-0": "alert.ios.foreground.autoDrop", "19-1": "boolean", "19-2": "Whether to automatically do as if the user swiped the notification if received while in foreground.", "10-0": "alert.ios.attachments", "10-1": "array of objects", "10-2": "A list of media attachments to add to the notification. iOS 10 only shows the first one but you may use the others in you have your own Notification Content Extension. Requires at least SDK v1.2.2.0.", "11-0": "alert.ios.attachments[].id", "11-1": "string", "11-2": "An optional identifier for use in your own Notification Content Extension if you have one.", "12-0": "alert.ios.attachments[].url", "12-1": "string", "12-2": "The URL to the media to download and attach to the notification.\nSee the [following documentation](https://developer.apple.com/reference/usernotifications/unnotificationattachment#1682051) for supported file formats and associated file size limits.", "13-0": "alert.ios.attachments[].type", "13-1": "string", "13-2": "The type of the file that `.url` points to. Necessary if the URL does not end with a proper file extension.\nValid official iOS values are: `public.png`, `public.jpeg`, `com.compuserve.gif`, `com.microsoft.waveform-audio`, `public.aiff-audio`, `public.mp3`, `public.mpeg-4-audio`, `public.mpeg`, `public.mpeg-2-video`, `public.mpeg-4`, `public.avi`.\nValid file-extension-like values are: `png`, `jpg`, `jpeg`, `gif`, `wav`, `wave`, `aiff`, `mp3`, `m4a`, `mp4a`, `mpg`, `mpeg`, `mp2`, `m2v`, `mp4`, `avi`.\nValid mime-type-like values are: `image/png`, `image/x-png`, `image/jpeg`, `image/gif`, `audio/wav`, `audio/x-wav`, `audio/aiff`, `audio/x-aiff`, `audio/mpeg`, `audio/mp3`, `audio/mpeg3`, `audio/mp4`, `video/mpeg`, `video/x-mpeg1`, `video/mpeg2`, `video/x-mpeg2`, `video/mp4`, `video/mpeg4`, `video/avi`.", "14-0": "alert.ios.attachments[].options", "14-1": "object", "14-2": "Optional list of additional raw options to pass to the [notification attachment constructor method](https://developer.apple.com/reference/usernotifications/unnotificationattachment/1649987-init)." }, "cols": 3, "rows": 20 } [/block] You can read more about those fields in the Apple documentation about [The Remote Notification Payload](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html). If neither `alert.ios.foreground.autoOpen` nor `alert.ios.foreground.autoDrop` are set, the SDK presents the notification. On iOS 10, if you properly integrated the SDK v1.2.2.0 or later the OS itself will present the notification. On prior versions of iOS or if the your code does not call `[WonderPush setupDelegateForUserNotificationCenter]` on initialization, the SDK will present an alert with the notification title and text. ---- The following table presents the Android specific options that can be user in the `alert.android` field: [block:parameters] { "data": { "h-0": "Field", "h-1": "Type", "h-2": "Description", "0-0": "alert.android.channel", "0-1": "string", "2-0": "alert.android.bigTitle", "3-0": "alert.android.bigText", "4-0": "alert.android.summaryText", "5-0": "alert.android.bigLargeIcon", "6-0": "alert.android.bigPicture", "7-0": "alert.android.lines", "2-1": "string or HTML\nValid for: `bigText`, `bigPicture` and `inbox`.", "3-1": "string or HTML\nValid for: `bigText`.", "4-1": "string or HTML\nValid for: `bigText`, `bigPicture` and `inbox`.", "5-1": "URL or resource name\nValid for: `bigPicture`.", "6-1": "URL\nValid for: `bigPicture`.", "7-1": "array of strings or HTML\nValid for: `inbox`.", "0-2": "The Android O notification channel to post the notification to. Prior to Android O, the WonderPush SDK can associate user preferences just about the same way.\nThe notification uses the default channel configured in the SDK if no value is provided.", "2-2": "An alternate title when the notification is expanded.", "3-2": "An alternate content when the notification is expanded.", "4-2": "A last line of text to show under a horizontal ruler.", "5-2": "An alternate large icon to show then the notification is expanded.", "6-2": "A large picture to display when the notification is expanded.", "7-2": "A list of single line sentences to show when the notification is expanded.", "8-0": "alert.android.html", "9-0": "alert.android.title", "10-0": "alert.android.text", "11-0": "alert.android.subText", "12-0": "alert.android.info", "13-0": "alert.android.ticker", "14-0": "alert.android.tag", "15-0": "alert.android.priority", "16-0": "alert.android.persons", "17-0": "alert.android.category", "18-0": "alert.android.color", "19-0": "alert.android.group", "20-0": "alert.android.sortKey", "21-0": "alert.android.localOnly", "22-0": "alert.android.number", "23-0": "alert.android.onlyAlertOnce", "24-0": "alert.android.when", "25-0": "alert.android.showWhen", "26-0": "alert.android.usesChronometer", "27-0": "alert.android.visibility", "28-0": "alert.android.lights", "32-0": "alert.android.vibrate", "33-0": "alert.android.sound", "34-0": "alert.android.ongoing", "35-0": "alert.android.progress", "36-0": "alert.android.smallIcon", "37-0": "alert.android.largeIcon", "38-0": "alert.android.buttons", "39-0": "alert.android.buttons[].label", "40-0": "alert.android.buttons[].icon", "41-0": "alert.android.buttons[].targetUrl", "42-0": "alert.android.buttons[].actions", "43-0": "alert.android.foreground", "44-0": "alert.android.foreground.priority", "45-0": "alert.android.foreground.autoOpen", "46-0": "alert.android.foreground.autoDrop", "8-1": "boolean", "18-2": "One of the [Color constants](https://developer.android.com/reference/android/graphics/Color.html), or an `#RRGGBB` color code.", "8-2": "Whether to treat every displayable string in this object as being HTML styled.\nOnly simple HTML styling tags are supported by Android", "9-1": "string or HTML", "10-1": "string or HTML", "11-1": "string or HTML", "12-1": "string or HTML", "13-1": "string or HTML", "14-1": "string, `null` or missing", "15-2": "One of:\n\n* `max`\n* `high`\n* `default`\n* `low`\n* `min`", "15-1": "string", "16-1": "array of URIs", "17-1": "string", "17-2": "One of the [Notification category constants](https://developer.android.com/reference/android/app/Notification.html#constants), like `message`, `promo` or `reminder`.", "18-1": "string", "19-1": "string", "20-1": "string", "21-1": "boolean", "23-1": "boolean", "25-1": "boolean", "26-1": "boolean", "34-1": "boolean", "45-1": "boolean", "46-1": "boolean", "19-2": "Set this notification to be part of a group of notifications sharing the same key. Grouped notifications may display in a cluster or stack on devices which support such rendering.", "16-2": "Add a person that is relevant to this notification. The system will also attempt to resolve `mailto:` and `tel:` schema URIs.", "37-2": "Add a large icon to the notification content view. In the platform template, this image will be shown on the left of the notification view in place of the small icon (which will be placed in a small badge atop the large icon).", "37-1": "URL or resource identifier", "29-0": "alert.android.lights.color", "30-0": "alert.android.lights.on", "31-0": "alert.android.lights.off", "28-1": "boolean or object", "28-2": "Set the desired color for the indicator LED on the device, as well as the blink duty cycle (specified in milliseconds). Not all devices will honor all (or even any) of these values.\nUse `false to deactivate`, `true` to user the default values, an object to override some values.", "29-2": "The LED color.", "30-2": "How long should the LED stay on.", "31-2": "How long should the LED stay off.", "29-1": "string", "30-1": "number of milliseconds", "31-1": "number of milliseconds", "32-1": "boolean or array of integers", "32-2": "Should the notification vibrate using the default pattern, or the provided one.", "33-1": "URL or resource identifier", "33-2": "Set the sound to play. It will be played using the default audio attributes for notifications.\nA notification that is noisy is more likely to be presented as a heads-up notification.", "21-2": "Set whether or not this notification should not bridge to other devices.\nSome notifications can be bridged to other devices for remote display. This hint can be set to recommend this notification not be bridged.", "22-1": "integer", "22-2": "Set the large number at the right-hand side of the notification. This is equivalent to `alert.android.info`, although it might show the number in a different font size for readability.", "34-2": "Set whether this is an \"ongoing\" notification. Ongoing notifications cannot be dismissed by the user.", "23-2": "Set this flag if you would only like the sound, vibrate and ticker to be played if the notification is not already showing.", "35-2": "Set the progress this notification represents. The platform template will represent this using a progress bar.\nUse `true` to set an undetermined state, or a number from 0 to 100 to set the corresponding percent completion to display.", "35-1": "boolean or 0 to 100 integer", "25-2": "Control whether the timestamp set with `alert.android.when` is shown in the content view. For apps targeting N and above, this defaults to false. For earlier apps, the default is true.", "36-1": "resource identifier", "36-2": "Set the small icon resource, which will be used to represent the notification in the status bar. The platform template for the expanded view will draw this icon in the left, unless a large icon has also been specified, in which case the small icon will be moved to the right-hand side.", "20-2": "Set a sort key that orders this notification among other notifications from the same package. This can be useful if an external sort was already applied and an app would like to preserve this. Notifications will be sorted lexicographically using this value, although providing different priorities in addition to providing sort key may cause this value to be ignored.", "13-2": "Set the \"ticker\" text which is sent to accessibility services.", "26-2": "Show the when field as a stopwatch. Instead of presenting when as a timestamp, the notification will show an automatically updating display of the minutes and seconds since `alert.android.when`. Useful when showing an elapsed time (like an ongoing phone call). The counter can also be set to count down to `alert.android.when` when using setChronometerCountDown(boolean).", "27-2": "One of:\n\n* `private` (the default)\n* `secret`\n* `public`", "27-1": "string", "24-1": "timestamp in milliseconds", "24-2": "Add a timestamp pertaining to the notification (usually the time the event occurred). For apps targeting N and above, this time is not shown anymore by default and must be opted into by using `alert.android.showWhen`.", "12-2": "A small piece of additional information pertaining to this notification. The platform template will draw this on the last line of the notification, at the far right (to the right of a smallIcon if it has been placed there).", "10-2": "Set the second line of text in the platform notification template.", "9-2": "Set the first line of text in the platform notification template.", "11-2": "This provides some additional information that is displayed in the notification.", "14-2": "If a notification using the same tag is currently displayed, it will be updated, otherwise, a new notification is shown.", "38-1": "array of objects", "38-2": "A list of up to 3 buttons to add to the notification in the notification center.", "39-1": "string", "39-2": "The button label.", "40-1": "resource identifier", "40-2": "The icon to display next to the button label.", "41-1": "URL", "41-2": "The content to open when clicking on the button, as an alternative to clicking on the notification itself.", "42-1": "array of objects", "42-2": "A list of background options to perform when clicking on the button.", "43-1": "object", "43-2": "Permits to override any of the above options if the notification is displayed while the application is foreground.", "44-1": "string", "44-2": "See `alert.android.priority`.\nDefaults to `high` in order to get the notification presented as heads-up by the system above your application.", "45-2": "Whether to automatically do as if the user clicked the notification if received while in foreground.", "46-2": "Whether to automatically do as if the user swiped the notification if received while in foreground.", "1-0": "alert.android.type", "1-1": "string", "1-2": "One of:\n\n* missing, or `null`: Default style, with expandable text.\n* `none`: No style, the text will be shown on a single line.\n* `bigText`: In the big text style, the expanded and collapsed state can show a different content.\n* `bigPicture`: The big picture style can display a large picture below a line of text.\n* `inbox`: Displays multiple sentences when expanded, each on a single line." }, "cols": 3, "rows": 47 } [/block] HTML styling support is limited to *about* the following tags: * `<br>` * `<h1>` `<h2>` `<h3>` `<h4>` `<h5>` `<h6>` * `<b>` `<i>` `<u>` `<big>` `<small>` `<strong>` `<em>` `<strike>` `<sub>` `<sup>` * `<a href="http://www.example.com">Link</a>` * `<img src="http://www.example.com/image.png"></img>` * `<div align="left|center|right">` * `<p dir="ltr|rtl">` * `<font size="24" color="red" face="Monospace">` `<tt>` * `<blockquote>` `<cite>` `<dfn>` ---- The following table presents the Web specific options that can be user in the `alert.web` field: [block:parameters] { "data": { "h-0": "Field", "h-1": "Type", "h-2": "Description", "0-0": "alert.web.dir", "1-0": "alert.web.lang", "2-0": "alert.web.body", "3-0": "alert.web.tag", "4-0": "alert.web.icon", "5-0": "alert.web.badge", "7-0": "alert.web.sound", "8-0": "alert.web.vibrate", "9-0": "alert.web.timestamp", "10-0": "alert.web.renotify", "11-0": "alert.web.silent", "12-0": "alert.web.noscreen", "13-0": "alert.web.requireInteraction", "14-0": "alert.web.sticky", "15-0": "alert.web.buttons", "0-1": "string", "1-1": "string", "2-1": "string", "3-1": "string", "4-1": "URL", "5-1": "URL", "7-1": "URL", "10-1": "boolean", "11-1": "boolean", "12-1": "boolean", "13-1": "boolean", "14-1": "boolean", "0-2": "`auto`, `ltr` or `rtl`. How the text should be aligned. Helps supporting right-to-left languages.", "1-2": "The notification’s language specifies the primary language for the notification’s title, body and the title of each of its buttons. Its value is a string. The empty string indicates that the primary language is unknown. Any other string must be interpreted as a language tag. Validity or well-formedness are not enforced.", "2-2": "Text text to display in the notification. This is the Web specific name of the `alert.text` field.", "3-2": "Notifications with same tag can be replaced, or updated, by this one.", "4-2": "The HTTPS URL of the icon to display next to the notification.\n*Must use HTTPS.*", "5-2": "A small icon displayed when there is not enough space to display the notification itself. It may also be displayed inside the notification with less visual priority than the icon itself.", "11-2": "Indicates that no sounds or vibrations should be made.", "13-2": "Indicates that on devices with a sufficiently large screen, the notification should remain readily available until the user activates or dismisses the notification.\nWonderPush sets this by default in order to prevent some browsers from automatically dismissing the notification after a few seconds.", "14-2": "Indicates that the end user should not be able to easily clear the notification.", "9-1": "timestamp in milliseconds", "9-2": "Indicates the time of the event for which the notification is shown.", "10-2": "Indicates if the user should get a visual notification after a notification has been updated.", "8-1": "array of integer", "8-2": "The vibration pattern.", "7-2": "The sound to play.", "12-2": "Indicates that the screen of the device should not be enabled.", "15-1": "array of objects", "15-2": "A list of buttons to add to the notification.\nNote: The Notification API specification uses the name `actions` for that.", "16-0": "alert.web.buttons[].label", "18-0": "alert.web.buttons[].icon", "19-0": "alert.web.buttons[].targetUrl", "20-0": "alert.web.buttons[].actions", "17-0": "alert.web.buttons[].action", "16-1": "string", "17-1": "string", "18-1": "URL", "19-1": "URL", "20-1": "array of objects", "16-2": "The notification button label.", "17-2": "The notification button identifier. An identifier is automatically generated if not specified.", "18-2": "A small button icon to display next to the button label.", "19-2": "The URL of the page to show when clicking on that button, as an alternative to clicking on the notification itself.", "20-2": "The optional list of actions that the button should perform.", "6-0": "alert.web.image", "6-1": "URL", "6-2": "The HTTPS URL of the big image to display below to the notification.\n*Must use HTTPS.*" }, "cols": 3, "rows": 21 } [/block] For more information, you can read the [Notification API](https://notifications.spec.whatwg.org/) living standard, but beware, it's a bit dry. [block:api-header] { "type": "basic", "title": "In-app components" } [/block] [block:parameters] { "data": { "h-0": "Field", "h-1": "Valid for", "h-2": "Type", "h-3": "Description", "0-0": "inApp.type", "0-1": "All", "0-2": "string", "1-0": "inApp.title", "2-0": "inApp.message", "3-0": "inApp.url", "4-0": "inApp.buttons", "1-3": "The optional title of the in-app dialog box.", "1-2": "string", "2-2": "string", "3-2": "a URL", "4-2": "array of objects", "2-3": "The content of the in-app dialog box.\n\nFor a `text` in-app, no formatting is performed, but new lines are preserved.\n\nFor `html` in-app, contains the HTML code to be rendered.", "0-3": "One of the supported notification types:\n\n* `text`: Displays a text message\n* `html`: Displays an inline HTML message\n* `url`: Displays the content of the given web page", "3-3": "The URL of the web page to render.", "3-1": "`url`", "1-1": "All", "2-1": "`text`, `html`", "4-1": "All", "5-0": "inApp.buttons[].label", "6-0": "inApp.buttons[].actions", "5-1": "All", "6-1": "All", "5-2": "string", "6-2": "array of objects", "4-3": "An optional list of up to 3 buttons to show in the in-app dialog box.\nIf you specify no button, the SDKs will automatically add a single *Close* button.", "5-3": "The label of a button.", "6-3": "The optional list of actions that the button should perform.\n`close` is always an implicit action." }, "cols": 4, "rows": 7 } [/block] [block:api-header] { "type": "basic", "title": "Push options" } [/block] [block:parameters] { "data": { "h-0": "Field", "h-1": "Type", "h-2": "Description", "0-0": "push.payload", "0-1": "object", "1-0": "push.custom", "1-1": "object", "2-0": "push.expirationDate", "2-1": "timestamp in milliseconds, or a string date using format `YYYY-MM-DDTHH:MM:SS.MMM+HH:MM`", "4-0": "push.priority", "4-1": "string", "4-2": "`normal` or `high`", "5-0": "push.android", "9-0": "push.ios", "10-0": "push.web", "5-1": "object", "9-1": "object", "10-1": "object", "1-2": "A key value mapping of custom data to give in the notification payload under the `custom` key.", "0-2": "Custom payload to merge with the notification payload itself.\nOn the contrary to the `custom` argument, this enabled you to control the whole notification payload.\nBe careful when writing into the `_wp` field (reserved for the WonderPush SDK) or `aps` field (reserved for Apple notifications).", "2-2": "The date after which the notification should be dropped if not already delivered to a user's device.\nUse 0 to try only once.", "5-2": "You can override any of the above keys for Android devices.\nThe following subkeys allow you to further control some Android-specific options.", "10-2": "You can override any of the above keys for Web devices.", "9-2": "You can override any of the above keys for iOS devices.", "6-0": "push.android.delayWhenIdle", "6-1": "boolean", "7-0": "push.android.collapseKey", "8-0": "push.android.restrictedPackageName", "8-1": "string", "7-1": "string", "6-2": "Indicates whether the message should not be sent until the device becomes active.", "7-2": "This parameter defines a group of messages that can be collapsed, so that only the last message gets sent when notifications can be delivered to a device anew.", "8-2": "This parameter specifies the package name of the application where the registration tokens must match in order to receive the message.", "3-0": "push.expirationTime", "3-1": "duration in milliseconds, or something like \"10 minutes\"", "3-2": "The duration after which the notification should be dropped if not already delivered to a user's device.\nUse 0 to try only once." }, "cols": 3, "rows": 11 } [/block] [block:api-header] { "type": "basic", "title": "Available `actions` for notification clicks and buttons" } [/block] Each action is composed of a `type` field, and any additional fields required by the chosen type. We present below one table per supported action type. [block:parameters] { "data": { "h-0": "Field", "h-1": "Valid for", "h-2": "Type", "h-3": "Description", "0-0": ".type", "1-0": ".event", "2-0": ".event.type", "3-0": ".event.custom", "4-0": ".custom", "5-0": ".method", "6-0": ".methodArgs", "7-0": ".url", "0-1": "All", "1-1": "`trackEvent`", "2-1": "`trackEvent`", "3-1": "`trackEvent`", "4-1": "`updateInstallation`", "5-1": "`method`", "6-1": "`method`", "7-1": "`link`", "0-2": "string", "1-2": "object", "2-2": "string", "3-2": "object", "4-2": "object", "5-2": "string", "6-2": "string", "7-2": "string", "1-3": "The event that should be tracked.", "2-3": "The event type, like the first argument of the `trackEvent()` method of the SDK.", "3-3": "Optional custom data to attach to the event payload.\nSee the [accepted format](http://www.wonderpush.com/docs/guide/custom-fields).", "4-3": "Custom data to set in the installation custom data.\nAny new field will be created, and any existing field will be overwritten.\nSee the [accepted format](http://www.wonderpush.com/docs/guide/custom-fields).", "5-3": "The callback method name.", "6-3": "The callback argument value.", "7-3": "The URL or deeplink to open.", "0-3": "* `\"close\"`: Simply closes the in-app dialog box.\n If not given explicitly, this action is always added implicitly.\n\n* `\"trackEvent\"`: Tracks a user event.\n This has the same effect as if you had called the `trackEvent()` method of the SDK manually, only you control it dynamically using push notifications.\n\n* `\"updateInstallation\"`: Modify the installation custom properties.\n This has the same effect as if you had called the `putInstallationCustomProperties()` method of the SDK manually, only you control it dynamically using push notifications.\n\n* `\"method\"`: Automatically triggers a registered callback.\n Take a look at the demo applications source code on GitHub to see how you can listen to those callbacks.\n\n* `\"link\"`: Opens the given URL in the browser, or using any application that is bond with it in the system.\n\n* `\"rating\"`: Opens the application store of device platform, on the page corresponding to your application." }, "cols": 4, "rows": 8 } [/block]
{"_id":"576b970a2f4daf0e00a62eea","excerpt":"Perform multiple calls in one HTTP round-trip.","link_external":false,"project":"5626303ed0f87e190014c548","slug":"post-batch","body":"Perform multiple calls in one HTTP round-trip. Limited to 100 requests per call, 1 MB of POST body for the whole batch, 10 seconds of execution time for the whole batch (above which the server closes the connection with a 500 error, but continues processing).\n\nThe `requests` parameter expects a JSON array of request object with the following fields:\n\n* `method`: HTTP verb string, one of `\"GET\"`, `\"POST\"`, `\"PUT\"`, `\"PATCH\"` or `\"DELETE\"`\n* `path`: string path to an end-point of the Management API, eg.: `\"/v1/management/installations/Android:fakedeviceid\"`\n* `args` *(optional)*: object giving the arguments values, eg.: `{\"userId\":null,\"overwrite\":false}`\n* `body` *(optional)*: expected body of the end point chosen in path, eg.: `{\"custom\":{\"string_foo\":\"bar\"}}`","category":"5763c690e3e44d0e000a4d41","title":"/batch","type":"post","updates":[],"version":"5626303fd0f87e190014c54b","__v":0,"order":5,"editedParams2":true,"isReference":true,"sync_unique":"","editedParams":true,"githubsync":"","hidden":false,"link_url":"","parentDoc":null,"user":"56262ffad0f87e190014c547","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -XPOST https://api.wonderpush.com/v1/management/batch \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN\n    -d requests='[\n    \t{\n      \t\"method\": \"POST\",\n        \"path\": \"/v1/management/installation/Android:fakedeviceid1\",\n        \"args\": {\n        \t\"userId\": null,\n          \"overwrite\": false\n        },\n        \"body\": {\n        \t\"custom\": {\n          \t\"string_foo\": \"bar\"\n          }\n        }\n      }\n    ]'"}]},"method":"post","params":[{"desc":"JSON array of request object. The expected fields are described below.","default":"","type":"array_object","name":"requests","in":"body","_id":"576b970a2f4daf0e00a62eeb","ref":"","required":true}],"results":{"codes":[{"language":"json","status":200,"name":"","code":"{\"responses\":[\n  {\"success\":true}\n]}"},{"status":400,"name":"","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"12033\",\n        \"message\": \"Too many requests are given in a single batch\"\n    }\n}","language":"json"}]},"settings":"","url":"/batch"},"createdAt":"2016-06-23T08:00:10.568Z","childrenPages":[]}

post/batch

Perform multiple calls in one HTTP round-trip.

Body Params

requests:
required
array of objects
JSON array of request object. The expected fields are described below.
Perform multiple calls in one HTTP round-trip. Limited to 100 requests per call, 1 MB of POST body for the whole batch, 10 seconds of execution time for the whole batch (above which the server closes the connection with a 500 error, but continues processing). The `requests` parameter expects a JSON array of request object with the following fields: * `method`: HTTP verb string, one of `"GET"`, `"POST"`, `"PUT"`, `"PATCH"` or `"DELETE"` * `path`: string path to an end-point of the Management API, eg.: `"/v1/management/installations/Android:fakedeviceid"` * `args` *(optional)*: object giving the arguments values, eg.: `{"userId":null,"overwrite":false}` * `body` *(optional)*: expected body of the end point chosen in path, eg.: `{"custom":{"string_foo":"bar"}}`

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 }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Perform multiple calls in one HTTP round-trip. Limited to 100 requests per call, 1 MB of POST body for the whole batch, 10 seconds of execution time for the whole batch (above which the server closes the connection with a 500 error, but continues processing). The `requests` parameter expects a JSON array of request object with the following fields: * `method`: HTTP verb string, one of `"GET"`, `"POST"`, `"PUT"`, `"PATCH"` or `"DELETE"` * `path`: string path to an end-point of the Management API, eg.: `"/v1/management/installations/Android:fakedeviceid"` * `args` *(optional)*: object giving the arguments values, eg.: `{"userId":null,"overwrite":false}` * `body` *(optional)*: expected body of the end point chosen in path, eg.: `{"custom":{"string_foo":"bar"}}`
{"_id":"57f7a82c3ae2bf170084b75b","project":"5626303ed0f87e190014c548","createdAt":"2016-10-07T13:50:36.688Z","excerpt":"Fetch installations","githubsync":"","hidden":false,"isReference":true,"updates":[],"user":"56262ffad0f87e190014c547","__v":1,"api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -XGET https://api.wonderpush.com/v1/management/installations \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN"}]},"method":"get","params":[{"_id":"576ba30f2f4daf0e00a62ff2","ref":"","in":"query","required":false,"desc":"Comma separated list of fields to return.","default":"","type":"array_string","name":"fields"},{"_id":"576ba30f2f4daf0e00a62ff1","ref":"","in":"query","required":false,"desc":"The number of first results to skip. Ignored when no sorting is provided. For an efficient deep pagination, always start at 0.","default":"0","type":"int","name":"offset"},{"_id":"576ba30f2f4daf0e00a62ff0","ref":"","in":"query","required":false,"desc":"The number of results to return, or `0` for counting only the results. This number may be adjusted for efficient deep paginations. The actual number of results may be less for the last few pages of an efficient deep pagination.","default":"50","type":"int","name":"limit"},{"_id":"576ba30f2f4daf0e00a62fef","ref":"","in":"query","required":false,"desc":"The cursor identifier for fetching the next result page. You should always use the whole URL provided in the pagination.next field of the previous request response. Do not try to reuse this identifier if changing the other parameters, as it is bound to them.","default":"","type":"string","name":"next"},{"_id":"576ba30f2f4daf0e00a62fee","ref":"","in":"query","required":false,"desc":"How to sort the results. You can sort on multiple fields. For efficient deep pagination, you should use \"none\". Eg.: \"-creationDate\" will give you the most recent installations, \"userId,creationDate\" will list the installations in chronological order, one user after an other.","default":"none","type":"string","name":"sort"},{"_id":"576ba30f2f4daf0e00a62fed","ref":"","in":"query","required":false,"desc":"The userIds of the installations to list. Give an empty value for null. Omit the parameter not to filter.","default":"","type":"array_string","name":"userIds"},{"_id":"576ba30f2f4daf0e00a62fec","ref":"","in":"query","required":false,"desc":"The minimum creationDate of the installations to list.","default":"","type":"string","name":"creationDateFrom"},{"_id":"576ba30f2f4daf0e00a62feb","ref":"","in":"query","required":false,"desc":"The maximum creationDate of the installations to list.","default":"","type":"string","name":"creationDateTo"},{"_id":"57f7a82c3ae2bf170084b75d","ref":"","in":"query","required":false,"desc":"The minimum updateDate of the installations to list.","default":"","type":"string","name":"updateDateFrom"},{"_id":"57f7a82c3ae2bf170084b75c","ref":"","in":"query","required":false,"desc":"The maximum updateDate of the installations to list.","default":"","type":"string","name":"updateDateTo"},{"_id":"594a7255eb5e84001a60b1c1","ref":"","in":"query","required":false,"desc":"The reachability states of the installations to list. Can be one or multiple values among: `optIn`, `optOut` or `softOptOut`.","default":"","type":"array_string","name":"reachability"},{"_id":"594a7255eb5e84001a60b1c0","ref":"","in":"query","required":false,"desc":"The platforms of the installations to list.","default":"","type":"array_string","name":"platforms"},{"_id":"594a7255eb5e84001a60b1bf","ref":"","in":"query","required":false,"desc":"Optional view id to apply over all segments defined in the Full view. All segments must use the same view, or the call will be refused.","default":"","type":"string","name":"viewId"},{"_id":"594a7255eb5e84001a60b1be","ref":"","in":"query","required":false,"desc":"Segment ids the installations to list must match. Every segment must share the same view id. This parameter cannot be used with criteria. You can prefix ids with a `+` to make them mandatory, or a `-` to make them forbidden, otherwise a segment is optional. An installation must match all mandatory segments, no forbidden segments and at least one optional segment to be listed.","default":"","type":"string","name":"segmentIds"},{"_id":"594a7255eb5e84001a60b1bd","ref":"","in":"query","required":false,"desc":"JSON dictionary of parameters with their associated values to be applied to the segment. Providing a value to a parameter `foo` will replace all occurences of `{{foo}}` with the given value. If you use multiple segments and want to give different values to parameters using the same name, you can give an JSON array of dictionnaries, respecting the order of the segments given in segmentIds. Segments that need no parameters can use `null` or an empty object.","default":"","type":"object","name":"segmentParams"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"count\": 123,\n  \"data\": [\n    {\n      \"id\": \"e2ba48f97a45be39f6c921e7b7a2adf65ad451b5\",\n      \"applicationId\": \"01906i1feoq2cu1p\",\n      \"userId\": null,\n      \"creationDate\": 1410539794529,\n      \"updateDate\": 1410539796299,\n      \"accessToken\": \"Hkn6z9fZCOEiqNn8ESSLkQx7fz5EyCEUJBvoRtasoqT2LDYPxDOh4ftGQRpnEn71NFw4VPQdySx8gJi7xrwHWl\",\n      \"application\": {\n        \"id\": \"01906i1feoq2cu1p\",\n        \"sdkVersion\": \"Android-1.1.0.0\",\n        \"version\": \"1.0\"\n      },\n      \"device\": {\n        \"id\": \"c51c72f4a3700183\",\n        \"platform\": \"Android\",\n        \"screenHeight\": 1186,\n        \"model\": \"Nexus 4\",\n        \"osVersion\": \"19\",\n        \"screenWidth\": 768,\n        \"brand\": \"LGE\",\n        \"capabilities\": {\n          \"touchscreenFullHand\": true,\n          \"telephonyCdma\": false,\n          \"sensorGyroscope\": true,\n          \"telephonyGsm\": true,\n          \"sipVoip\": true,\n          \"touchscreenTwoFingers\": true,\n          \"touchscreenDistinct\": true,\n          \"gps\": true,\n          \"sensorProximity\": true,\n          \"sensorStepCounter\": false,\n          \"telephony\": true,\n          \"ir\": false,\n          \"sensorCompass\": true,\n          \"sensorLight\": true,\n          \"sensorStepDetector\": false,\n          \"microphone\": true,\n          \"camera\": true,\n          \"wifiDirect\": true,\n          \"sensorBarometer\": true,\n          \"usbAccessory\": true,\n          \"sensorAccelerometer\": true,\n          \"wifi\": true,\n          \"bluetooth\": true,\n          \"networkLocation\": true,\n          \"sip\": true,\n          \"frontCamera\": true,\n          \"bluetoothLe\": true,\n          \"nfc\": true,\n          \"usbHost\": false,\n          \"touchscreen\": true\n        },\n        \"configuration\": {\n          \"locale\": \"fr_FR\",\n          \"carrier\": \"Bouygues Telecom\",\n          \"timeZone\": \"Europe/Paris\"\n        },\n        \"screenDensity\": 320\n      },\n      \"preferences\": {\n        \"subscriptionStatus\": \"optIn\"\n      },\n      \"pushToken\": {\n        \"meta\": {\n          \"updateDate\": 1410539796298\n        },\n        \"data\": \"02J0fDm4dwsAylLXKr47YhN9CfjU9AimDSXVKL83OnPVwEaZU1EfcLww5LGlye_5mGGgaGcbrXtXU6HKCUXabGUHBNX0V4htJvHBAflIgABe4H5SskfwA_Ie3WHmjAfiy2whXUvMWK5gH6jRZOwQJltiMbilfoPxvF\"\n      },\n      \"custom\": {\n        \"int_age\": 27,\n        \"string_foo\": \"bar\",\n        \"string_likes\": [\"pizza\", \"beer\"]\n      }\n    },\n    //...\n  ],\n  \"pagination\": {\n    \"previous\": null,\n    \"next\": \"https://api.wonderpush.com/v1/management/installations?accessToken=YOUR_APPLICATION_ACCESS_TOKEN&limit=50&pretty=0&applicationId=01906i1feoq2cu1p&next=0GwZy6UsvjVdYTT59ChWqcr14HeMLmYrpKi3SfR8ilMYmr5xKxgL9HU5fpNSLCfXQPyicvW766zImO7qu_CyWfZuJXm0oR1No5yRyPcAPllNTc0dma4H5xnqhKXDbswsK8J-H9f5Wipufzpi1AihZr7rNoXXnBv43wmDM6pxbNo\"\n  }\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"/installations"},"slug":"get-installations","title":"/installations","version":"5626303fd0f87e190014c54b","link_url":"","order":6,"category":"5763c690e3e44d0e000a4d41","link_external":false,"parentDoc":null,"sync_unique":"","type":"get","body":"Search and list installations. This calls enables you to export all installations, or only a subset of them. You can filter by user and restrict results from a given time window. For efficient deep pagination, you must use `sort=none`, using a large offset is highly discouraged.\n\nThe result is comprised of a `data` array, and a `pagination` object containing `previous` and `next`, two complete URLs for navigating through the result set. Always use the URLs as is and do not add or remove parameters. When doing efficient deep pagination, only the `pagination.next` page is available.","next":{"description":"","pages":[]},"childrenPages":[]}

get/installations

Fetch installations

Query Params

fields:
array of strings
Comma separated list of fields to return.
offset:
integer0
The number of first results to skip. Ignored when no sorting is provided. For an efficient deep pagination, always start at 0.
limit:
integer50
The number of results to return, or `0` for counting only the results. This number may be adjusted for efficient deep paginations. The actual number of results may be less for the last few pages of an efficient deep pagination.
next:
string
The cursor identifier for fetching the next result page. You should always use the whole URL provided in the pagination.next field of the previous request response. Do not try to reuse this identifier if changing the other parameters, as it is bound to them.
sort:
stringnone
How to sort the results. You can sort on multiple fields. For efficient deep pagination, you should use "none". Eg.: "-creationDate" will give you the most recent installations, "userId,creationDate" will list the installations in chronological order, one user after an other.
userIds:
array of strings
The userIds of the installations to list. Give an empty value for null. Omit the parameter not to filter.
creationDateFrom:
string
The minimum creationDate of the installations to list.
creationDateTo:
string
The maximum creationDate of the installations to list.
updateDateFrom:
string
The minimum updateDate of the installations to list.
updateDateTo:
string
The maximum updateDate of the installations to list.
reachability:
array of strings
The reachability states of the installations to list. Can be one or multiple values among: `optIn`, `optOut` or `softOptOut`.
platforms:
array of strings
The platforms of the installations to list.
viewId:
string
Optional view id to apply over all segments defined in the Full view. All segments must use the same view, or the call will be refused.
segmentIds:
string
Segment ids the installations to list must match. Every segment must share the same view id. This parameter cannot be used with criteria. You can prefix ids with a `+` to make them mandatory, or a `-` to make them forbidden, otherwise a segment is optional. An installation must match all mandatory segments, no forbidden segments and at least one optional segment to be listed.
segmentParams:
object
JSON dictionary of parameters with their associated values to be applied to the segment. Providing a value to a parameter `foo` will replace all occurences of `{{foo}}` with the given value. If you use multiple segments and want to give different values to parameters using the same name, you can give an JSON array of dictionnaries, respecting the order of the segments given in segmentIds. Segments that need no parameters can use `null` or an empty object.
Search and list installations. This calls enables you to export all installations, or only a subset of them. You can filter by user and restrict results from a given time window. For efficient deep pagination, you must use `sort=none`, using a large offset is highly discouraged. The result is comprised of a `data` array, and a `pagination` object containing `previous` and `next`, two complete URLs for navigating through the result set. Always use the URLs as is and do not add or remove parameters. When doing efficient deep pagination, only the `pagination.next` page is available.

User Information

Try It Out

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

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Search and list installations. This calls enables you to export all installations, or only a subset of them. You can filter by user and restrict results from a given time window. For efficient deep pagination, you must use `sort=none`, using a large offset is highly discouraged. The result is comprised of a `data` array, and a `pagination` object containing `previous` and `next`, two complete URLs for navigating through the result set. Always use the URLs as is and do not add or remove parameters. When doing efficient deep pagination, only the `pagination.next` page is available.
{"_id":"576b992e2f4daf0e00a62eee","__v":1,"project":"5626303ed0f87e190014c548","sync_unique":"","title":"/installations/:installationId","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -XGET https://api.wonderpush.com/v1/management/installations/bfbd475402abf833c226a7144ad9f7cb45629abc \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d userId="}]},"method":"get","params":[{"name":"userId","in":"query","_id":"576b992e2f4daf0e00a62ef1","ref":"","required":true,"desc":"Id of the associated user. Leave empty for `null`.","default":"","type":"string"},{"desc":"Id of the installation to retrieve.","default":"","type":"string","name":"installationId","in":"path","_id":"576b992e2f4daf0e00a62ef0","ref":"","required":true},{"name":"fields","in":"query","_id":"576b992e2f4daf0e00a62eef","ref":"","required":false,"desc":"Comma separated list of fields to return.","default":"","type":"array_string"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"id\": \"e3e2d060c9c92ae72f5b90461fc65188863092b7\",\n  \"creationDate\": 1436185983232,\n  \"updateDate\": 1436185983553,\n  \"userId\": null,\n  \"applicationId\": \"01906i1feoq2cu1p\",\n  \"accessToken\": \"AgJWds5SDcMqc1Jb6LTAdsUhh2vPyaeucbPUagRfkwRGCszVRxY5kD0OnWClaOuGShU04V1sP1yagBM5KHmc0n\",\n  \"application\": {\n    \"id\": \"01906i1feoq2cu1p\",\n    \"sdkVersion\": \"iOS-1.2.0.0\",\n    \"version\": \"1.0.0\"\n  },\n  \"device\": {\n    \"id\": \"97AF80A7-5D37-4C74-309B-BCD692A8E412\",\n    \"platform\": \"iOS\",\n    \"screenHeight\": 1024,\n    \"model\": \"iPad 4 (WiFi)\",\n    \"osVersion\": \"8.3\",\n    \"screenWidth\": 768,\n    \"name\": \"John Doe's iPad\",\n    \"brand\": \"Apple\",\n    \"screenDensity\": 2\n  },\n  \"pushToken\": {\n    \"data\": \"d94e486c61cde836c50dae573ba4903ca1aed973792e53128fd7d6bb0c657d17\",\n    \"meta\": {\n      \"updateDate\": 1436186029623\n    }\n  },\n  \"custom\": {\n    \"int_age\": 27,\n    \"string_foo\": \"bar\",\n    \"string_likes\": [\"pizza\", \"beer\"]\n  }\n}","name":""},{"status":400,"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing parameter userId\"\n    }\n}","name":""}]},"settings":"","url":"/installations/:installationId"},"hidden":false,"link_external":false,"link_url":"","version":"5626303fd0f87e190014c54b","body":"","category":"5763c690e3e44d0e000a4d41","createdAt":"2016-06-23T08:09:18.623Z","editedParams2":true,"githubsync":"","isReference":true,"order":7,"parentDoc":null,"slug":"get-installations-installationid","type":"get","user":"56262ffad0f87e190014c547","editedParams":true,"excerpt":"Get an installation","next":{"description":"","pages":[]},"updates":[],"childrenPages":[]}

get/installations/:installationId

Get an installation

Path Params

installationId:
required
string
Id of the installation to retrieve.

Query Params

userId:
required
string
Id of the associated user. Leave empty for `null`.
fields:
array of strings
Comma separated list of fields to return.

User Information

Try It Out

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

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"576b99e4a478d417005b0b3c","api":{"url":"/installations/:installationId","auth":"required","examples":{"codes":[{"language":"curl","code":"curl -XPOST https://api.wonderpush.com/v1/management/installations/bfbd475402abf833c226a7144ad9f7cb45629abc \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d userId= \\\n    -d overwrite=false \\\n    -d body='{\"custom\":{\"string_foo\":\"bar\"}}'"}]},"method":"post","params":[{"name":"userId","in":"body","_id":"576b99e4a478d417005b0b40","ref":"","required":true,"desc":"Id of the associated user. Leave empty for null.","default":"","type":"string"},{"default":"","type":"string","name":"installationId","in":"path","_id":"576b99e4a478d417005b0b3f","ref":"","required":true,"desc":"Id of an installation if you know it, or alternatively the device platform and device id joined by a colon. Note that an installationId is not a random string and is always used in pair with its associated userId, which you must provide in the userId parameter."},{"_id":"576b99e4a478d417005b0b3e","ref":"","required":true,"desc":"JSON body","default":"","type":"object","name":"body","in":"body"},{"_id":"576b99e4a478d417005b0b3d","ref":"","required":true,"desc":"Whether to overwrite the whole object or to partially update it.","default":"","type":"boolean","name":"overwrite","in":"body"}],"results":{"codes":[{"status":200,"language":"json","code":"{\"success\":true}","name":""},{"status":400,"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing parameter userId\"\n    }\n}","name":""},{"status":409,"language":"json","code":"{\n    \"error\": {\n        \"status\": 409,\n        \"code\": \"12040\",\n        \"message\": \"Concurrent modification. Regroup and batch calls, or retry later.\"\n    }\n}"}]},"settings":""},"body":"Calling this end-point with `overwrite=true` is equivalent to using the `PATCH` HTTP verb instead, and calling it with `overwrite=false` is equivalent to using the `PUT` HTTP verb instead.\nThis end-point is hence only proposed for convenience where your library does not enable you to vary the HTTP verb easily.","editedParams":true,"hidden":false,"isReference":true,"version":"5626303fd0f87e190014c54b","category":"5763c690e3e44d0e000a4d41","editedParams2":true,"excerpt":"Update an installation","link_external":false,"next":{"description":"","pages":[]},"order":8,"type":"post","createdAt":"2016-06-23T08:12:20.729Z","parentDoc":null,"sync_unique":"","updates":[],"user":"56262ffad0f87e190014c547","__v":1,"githubsync":"","link_url":"","project":"5626303ed0f87e190014c548","slug":"post-installations-installationid","title":"/installations/:installationId","childrenPages":[]}

post/installations/:installationId

Update an installation

Path Params

installationId:
required
string
Id of an installation if you know it, or alternatively the device platform and device id joined by a colon. Note that an installationId is not a random string and is always used in pair with its associated userId, which you must provide in the userId parameter.

Body Params

userId:
required
string
Id of the associated user. Leave empty for null.
body:
required
object
JSON body
overwrite:
required
boolean
Whether to overwrite the whole object or to partially update it.
Calling this end-point with `overwrite=true` is equivalent to using the `PATCH` HTTP verb instead, and calling it with `overwrite=false` is equivalent to using the `PUT` HTTP verb instead. This end-point is hence only proposed for convenience where your library does not enable you to vary the HTTP verb easily.

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 }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Calling this end-point with `overwrite=true` is equivalent to using the `PATCH` HTTP verb instead, and calling it with `overwrite=false` is equivalent to using the `PUT` HTTP verb instead. This end-point is hence only proposed for convenience where your library does not enable you to vary the HTTP verb easily.
{"_id":"576b9a1574a8640e004ce839","user":"56262ffad0f87e190014c547","__v":1,"isReference":true,"parentDoc":null,"createdAt":"2016-06-23T08:13:09.040Z","editedParams2":true,"link_external":false,"link_url":"","githubsync":"","hidden":false,"next":{"description":"","pages":[]},"slug":"patch-installations-installationid","body":"","category":"5763c690e3e44d0e000a4d41","editedParams":true,"excerpt":"Partially update an installation","sync_unique":"","title":"/installations/:installationId","type":"patch","updates":[],"api":{"settings":"","url":"/installations/:installationId","auth":"required","examples":{"codes":[{"language":"curl","code":"curl -XPATCH https://api.wonderpush.com/v1/installations/bfbd475402abf833c226a7144ad9f7cb45629abc \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d userId= \\\n    -d body='{\"custom\":{\"string_foo\":\"bar\"}}'"}]},"method":"patch","params":[{"required":true,"desc":"Id of the associated user. Leave empty for null.","default":"","type":"string","name":"userId","in":"body","_id":"576b99e4a478d417005b0b40","ref":""},{"desc":"Id of an installation if you know it, or alternatively the device platform and device id joined by a colon. Note that an installationId is not a random string and is always used in pair with its associated userId, which you must provide in the userId parameter.","default":"","type":"string","name":"installationId","in":"path","_id":"576b99e4a478d417005b0b3f","ref":"","required":true},{"name":"body","in":"body","_id":"576b99e4a478d417005b0b3e","ref":"","required":true,"desc":"JSON body","default":"","type":"object"}],"results":{"codes":[{"language":"json","code":"{\"success\":true}","name":"","status":200},{"status":400,"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing parameter userId\"\n    }\n}","name":""},{"code":"{\n    \"error\": {\n        \"status\": 409,\n        \"code\": \"12040\",\n        \"message\": \"Concurrent modification. Regroup and batch calls, or retry later.\"\n    }\n}","status":409,"language":"json"}]}},"order":9,"project":"5626303ed0f87e190014c548","version":"5626303fd0f87e190014c54b","childrenPages":[]}

patch/installations/:installationId

Partially update an installation

Path Params

installationId:
required
string
Id of an installation if you know it, or alternatively the device platform and device id joined by a colon. Note that an installationId is not a random string and is always used in pair with its associated userId, which you must provide in the userId parameter.

Body Params

userId:
required
string
Id of the associated user. Leave empty for null.
body:
required
object
JSON body

User Information

Try It Out

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

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"576b9a2ba478d417005b0b41","api":{"url":"/installations/:installationId","auth":"required","examples":{"codes":[{"language":"curl","code":"curl -XPUT https://api.wonderpush.com/v1/management/installations/bfbd475402abf833c226a7144ad9f7cb45629abc \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d userId= \\\n    -d body='{\"custom\":{\"string_foo\":\"bar\"}}'"}]},"method":"put","params":[{"default":"","type":"string","name":"userId","in":"body","_id":"576b99e4a478d417005b0b40","ref":"","required":true,"desc":"Id of the associated user. Leave empty for null."},{"in":"path","_id":"576b99e4a478d417005b0b3f","ref":"","required":true,"desc":"Id of an installation if you know it, or alternatively the device platform and device id joined by a colon. Note that an installationId is not a random string and is always used in pair with its associated userId, which you must provide in the userId parameter.","default":"","type":"string","name":"installationId"},{"name":"body","in":"body","_id":"576b99e4a478d417005b0b3e","ref":"","required":true,"desc":"JSON body","default":"","type":"object"}],"results":{"codes":[{"status":200,"language":"json","code":"{\"success\":true}","name":""},{"status":400,"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing parameter userId\"\n    }\n}","name":""},{"status":409,"language":"json","code":"{\n    \"error\": {\n        \"status\": 409,\n        \"code\": \"12040\",\n        \"message\": \"Concurrent modification. Regroup and batch calls, or retry later.\"\n    }\n}"}]},"settings":""},"editedParams":true,"editedParams2":true,"hidden":false,"link_external":false,"order":10,"title":"/installations/:installationId","updates":[],"body":"","createdAt":"2016-06-23T08:13:31.027Z","isReference":true,"next":{"description":"","pages":[]},"slug":"put-installations-installationid","version":"5626303fd0f87e190014c54b","__v":1,"parentDoc":null,"project":"5626303ed0f87e190014c548","sync_unique":"","type":"put","user":"56262ffad0f87e190014c547","category":"5763c690e3e44d0e000a4d41","excerpt":"Fully update or create an installation","githubsync":"","link_url":"","childrenPages":[]}

put/installations/:installationId

Fully update or create an installation

Path Params

installationId:
required
string
Id of an installation if you know it, or alternatively the device platform and device id joined by a colon. Note that an installationId is not a random string and is always used in pair with its associated userId, which you must provide in the userId parameter.

Body Params

userId:
required
string
Id of the associated user. Leave empty for null.
body:
required
object
JSON body

User Information

Try It Out

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

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"57f7ac2d3ae2bf170084b766","createdAt":"2016-10-07T14:07:41.838Z","parentDoc":null,"slug":"get-users","title":"/users","sync_unique":"","type":"get","user":"56262ffad0f87e190014c547","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -XGET https://api.wonderpush.com/v1/management/users \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN"}]},"method":"get","params":[{"required":false,"desc":"Comma separated list of fields to return.","default":"","type":"array_string","name":"fields","_id":"576ba30f2f4daf0e00a62ff2","ref":"","in":"query"},{"type":"int","name":"offset","_id":"576ba30f2f4daf0e00a62ff1","ref":"","in":"query","required":false,"desc":"The number of first results to skip. Ignored when no sorting is provided. For an efficient deep pagination, always start at 0.","default":"0"},{"desc":"The number of results to return. This number may be adjusted for efficient deep paginations. The actual number of results may be less for the last few pages of an efficient deep pagination.","default":"50","type":"int","name":"limit","_id":"576ba30f2f4daf0e00a62ff0","ref":"","in":"query","required":false},{"name":"next","_id":"576ba30f2f4daf0e00a62fef","ref":"","in":"query","required":false,"desc":"The cursor identifier for fetching the next result page. You should always use the whole URL provided in the pagination.next field of the previous request response. Do not try to reuse this identifier if changing the other parameters, as it is bound to them.","default":"","type":"string"},{"type":"string","name":"sort","_id":"576ba30f2f4daf0e00a62fee","ref":"","in":"query","required":false,"desc":"How to sort the results. You can sort on multiple fields. For efficient deep pagination, you should use \"none\". Eg.: \"-creationDate\" will give you the most recent users.","default":"none"},{"desc":"The minimum creationDate of the users to list.","default":"","type":"string","name":"creationDateFrom","_id":"576ba30f2f4daf0e00a62fec","ref":"","in":"query","required":false},{"_id":"576ba30f2f4daf0e00a62feb","ref":"","in":"query","required":false,"desc":"The maximum creationDate of the users to list.","default":"","type":"string","name":"creationDateTo"},{"_id":"57f7a82c3ae2bf170084b75d","ref":"","in":"query","required":false,"desc":"The minimum updateDate of the users to list.","default":"","type":"string","name":"updateDateFrom"},{"name":"updateDateTo","_id":"57f7a82c3ae2bf170084b75c","ref":"","in":"query","required":false,"desc":"The maximum updateDate of the users to list.","default":"","type":"string"}],"results":{"codes":[{"name":"","status":200,"language":"json","code":"{\n  \"count\": 123,\n  \"data\": [\n    {\n      \"id\": \"john_doe\",\n      \"applicationId\": \"01906i1feoq2cu1p\",\n      \"creationDate\": 1410539794529,\n      \"updateDate\": 1410539796299,\n      \"custom\": {\n        \"int_age\": 27,\n        \"string_foo\": \"bar\",\n        \"string_likes\": [\"pizza\", \"beer\"]\n      }\n    },\n    //...\n  ],\n  \"pagination\": {\n    \"previous\": null,\n    \"next\": \"https://api.wonderpush.com/v1/management/users?accessToken=YOUR_APPLICATION_ACCESS_TOKEN&limit=50&pretty=0&applicationId=01906i1feoq2cu1p&next=0GwZy6UsvjVdYTT59ChWqcr14HeMLmYrpKi3SfR8ilMYmr5xKxgL9HU5fpNSLCfXQPyicvW766zImO7qu_CyWfZuJXm0oR1No5yRyPcAPllNTc0dma4H5xnqhKXDbswsK8J-H9f5Wipufzpi1AihZr7rNoXXnBv43wmDM6pxbNo\"\n  }\n}"},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"/users"},"category":"5763c690e3e44d0e000a4d41","excerpt":"Fetch users","hidden":false,"link_url":"","version":"5626303fd0f87e190014c54b","__v":1,"body":"Search and list users. This calls enables you to export all users, or only a subset of them. You can restrict results from a given time window. For efficient deep pagination, you must use `sort=none`, using a large offset is highly discouraged.\n\nThe result is comprised of a `data` array, and a `pagination` object containing `previous` and `next`, two complete URLs for navigating through the result set. Always use the URLs as is and do not add or remove parameters. When doing efficient deep pagination, only the `pagination.next` page is available.","isReference":true,"link_external":false,"project":"5626303ed0f87e190014c548","githubsync":"","order":11,"updates":[],"next":{"description":"","pages":[]},"childrenPages":[]}

get/users

Fetch users

Query Params

fields:
array of strings
Comma separated list of fields to return.
offset:
integer0
The number of first results to skip. Ignored when no sorting is provided. For an efficient deep pagination, always start at 0.
limit:
integer50
The number of results to return. This number may be adjusted for efficient deep paginations. The actual number of results may be less for the last few pages of an efficient deep pagination.
next:
string
The cursor identifier for fetching the next result page. You should always use the whole URL provided in the pagination.next field of the previous request response. Do not try to reuse this identifier if changing the other parameters, as it is bound to them.
sort:
stringnone
How to sort the results. You can sort on multiple fields. For efficient deep pagination, you should use "none". Eg.: "-creationDate" will give you the most recent users.
creationDateFrom:
string
The minimum creationDate of the users to list.
creationDateTo:
string
The maximum creationDate of the users to list.
updateDateFrom:
string
The minimum updateDate of the users to list.
updateDateTo:
string
The maximum updateDate of the users to list.
Search and list users. This calls enables you to export all users, or only a subset of them. You can restrict results from a given time window. For efficient deep pagination, you must use `sort=none`, using a large offset is highly discouraged. The result is comprised of a `data` array, and a `pagination` object containing `previous` and `next`, two complete URLs for navigating through the result set. Always use the URLs as is and do not add or remove parameters. When doing efficient deep pagination, only the `pagination.next` page is available.

User Information

Try It Out

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

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Search and list users. This calls enables you to export all users, or only a subset of them. You can restrict results from a given time window. For efficient deep pagination, you must use `sort=none`, using a large offset is highly discouraged. The result is comprised of a `data` array, and a `pagination` object containing `previous` and `next`, two complete URLs for navigating through the result set. Always use the URLs as is and do not add or remove parameters. When doing efficient deep pagination, only the `pagination.next` page is available.
{"_id":"576b9a8c2a83f70e006ca218","order":12,"project":"5626303ed0f87e190014c548","title":"/users/:userId","editedParams2":true,"excerpt":"Get a user","hidden":false,"link_external":false,"version":"5626303fd0f87e190014c54b","category":"5763c690e3e44d0e000a4d41","createdAt":"2016-06-23T08:15:08.180Z","editedParams":true,"slug":"get-users-userid","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -XPOST https://api.wonderpush.com/v1/management/deliveries \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d userId=john_doe"}]},"method":"get","params":[{"type":"string","name":"userId","in":"path","_id":"576b992e2f4daf0e00a62ef1","ref":"","required":true,"desc":"Id of the associated user. Leave empty for `null`.","default":""},{"type":"array_string","name":"fields","in":"query","_id":"576b992e2f4daf0e00a62eef","ref":"","required":false,"desc":"Comma separated list of fields to return.","default":""}],"results":{"codes":[{"code":"{\n  \"id\": \"john_doe\",\n  \"creationDate\": 1436185983232,\n  \"updateDate\": 1436185983553,\n  \"applicationId\": \"01906i1feoq2cu1p\",\n  \"custom\": {\n    \"int_age\": 27,\n    \"string_foo\": \"bar\",\n    \"string_likes\": [\"pizza\", \"beer\"]\n  }\n}","name":"","status":200,"language":"json"},{"name":"","status":400,"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing parameter userId\"\n    }\n}"}]},"settings":"","url":"/users/:userId"},"isReference":true,"type":"get","updates":[],"link_url":"","parentDoc":null,"sync_unique":"","user":"56262ffad0f87e190014c547","__v":0,"body":"","githubsync":"","childrenPages":[]}

get/users/:userId

Get a user

Path Params

userId:
required
string
Id of the associated user. Leave empty for `null`.

Query Params

fields:
array of strings
Comma separated list of fields to return.

User Information

Try It Out

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

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"576b9b31de333e0e00d0a92d","version":"5626303fd0f87e190014c54b","createdAt":"2016-06-23T08:17:53.575Z","editedParams2":true,"githubsync":"","sync_unique":"","title":"/users/:userId","user":"56262ffad0f87e190014c547","link_url":"","body":"Calling this end-point with `overwrite=true` is equivalent to using the `PATCH` HTTP verb instead, and calling it with `overwrite=false` is equivalent to using the `PUT` HTTP verb instead.\nThis end-point is hence only proposed for convenience where your library does not enable you to vary the HTTP verb easily.","category":"5763c690e3e44d0e000a4d41","editedParams":true,"excerpt":"Update a user","link_external":false,"hidden":false,"isReference":true,"type":"post","slug":"post-users-userid","updates":[],"__v":1,"api":{"settings":"","url":"/users/:userId","auth":"required","examples":{"codes":[{"language":"curl","code":"curl -XPOST https://api.wonderpush.com/v1/management/users/john_doe \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d overwrite=false \\\n    -d body='{\"custom\":{\"string_foo\":\"bar\"}}'"}]},"method":"post","params":[{"required":true,"desc":"Id of the user.","default":"","type":"string","name":"userId","in":"path","_id":"576b992e2f4daf0e00a62ef1","ref":""},{"default":"","type":"object","name":"body","in":"body","_id":"576b992e2f4daf0e00a62eef","ref":"","required":true,"desc":"JSON body"},{"_id":"576b9b31de333e0e00d0a92e","ref":"","required":true,"desc":"Whether to overwrite the whole object or to partially update it.","default":"","type":"boolean","name":"overwrite","in":"body"}],"results":{"codes":[{"status":200,"language":"json","code":"{\"success\":true}","name":""},{"name":"","status":400,"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing parameter userId\"\n    }\n}"},{"language":"json","code":"{\n    \"error\": {\n        \"status\": 409,\n        \"code\": \"12040\",\n        \"message\": \"Concurrent modification. Regroup and batch calls, or retry later.\"\n    }\n}","status":409}]}},"next":{"description":"","pages":[]},"order":13,"parentDoc":null,"project":"5626303ed0f87e190014c548","childrenPages":[]}

post/users/:userId

Update a user

Path Params

userId:
required
string
Id of the user.

Body Params

body:
required
object
JSON body
overwrite:
required
boolean
Whether to overwrite the whole object or to partially update it.
Calling this end-point with `overwrite=true` is equivalent to using the `PATCH` HTTP verb instead, and calling it with `overwrite=false` is equivalent to using the `PUT` HTTP verb instead. This end-point is hence only proposed for convenience where your library does not enable you to vary the HTTP verb easily.

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 }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Calling this end-point with `overwrite=true` is equivalent to using the `PATCH` HTTP verb instead, and calling it with `overwrite=false` is equivalent to using the `PUT` HTTP verb instead. This end-point is hence only proposed for convenience where your library does not enable you to vary the HTTP verb easily.
{"_id":"576b9f4b74a8640e004ce84c","link_external":false,"title":"/users/:userId","user":"56262ffad0f87e190014c547","__v":1,"body":"","category":"5763c690e3e44d0e000a4d41","hidden":false,"project":"5626303ed0f87e190014c548","type":"patch","updates":[],"version":"5626303fd0f87e190014c54b","editedParams":true,"editedParams2":true,"excerpt":"Partially update a user","isReference":true,"api":{"examples":{"codes":[{"language":"curl","code":"curl -XPATCH https://api.wonderpush.com/v1/management/users/john_doe \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d body='{\"custom\":{\"string_foo\":\"bar\"}}'"}]},"method":"patch","params":[{"_id":"576b992e2f4daf0e00a62ef1","ref":"","required":true,"desc":"Id of the user.","default":"","type":"string","name":"userId","in":"path"},{"in":"body","_id":"576b992e2f4daf0e00a62eef","ref":"","required":true,"desc":"JSON body","default":"","type":"object","name":"body"}],"results":{"codes":[{"status":200,"language":"json","code":"{\"success\":true}","name":""},{"status":400,"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing parameter userId\"\n    }\n}","name":""},{"status":409,"language":"json","code":"{\n    \"error\": {\n        \"status\": 409,\n        \"code\": \"12040\",\n        \"message\": \"Concurrent modification. Regroup and batch calls, or retry later.\"\n    }\n}"}]},"settings":"","url":"/users/:userId","auth":"required"},"link_url":"","next":{"description":"","pages":[]},"parentDoc":null,"slug":"patch-users-userid","sync_unique":"","createdAt":"2016-06-23T08:35:23.498Z","githubsync":"","order":14,"childrenPages":[]}

patch/users/:userId

Partially update a user

Path Params

userId:
required
string
Id of the user.

Body Params

body:
required
object
JSON body

User Information

Try It Out

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

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"576b9f5d6c24681700c900f1","title":"/users/:userId","type":"put","category":"5763c690e3e44d0e000a4d41","editedParams2":true,"githubsync":"","hidden":false,"link_external":false,"slug":"put-users-userid","version":"5626303fd0f87e190014c54b","__v":1,"createdAt":"2016-06-23T08:35:41.770Z","isReference":true,"order":15,"api":{"examples":{"codes":[{"language":"curl","code":"curl -XPUT https://api.wonderpush.com/v1/management/users/john_doe \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d body='{\"custom\":{\"string_foo\":\"bar\"}}'"}]},"method":"put","params":[{"_id":"576b992e2f4daf0e00a62ef1","ref":"","required":true,"desc":"Id of the user.","default":"","type":"string","name":"userId","in":"path"},{"in":"body","_id":"576b992e2f4daf0e00a62eef","ref":"","required":true,"desc":"JSON body","default":"","type":"object","name":"body"}],"results":{"codes":[{"status":200,"language":"json","code":"{\"success\":true}","name":""},{"status":400,"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing parameter userId\"\n    }\n}","name":""},{"status":409,"language":"json","code":"{\n    \"error\": {\n        \"status\": 409,\n        \"code\": \"12040\",\n        \"message\": \"Concurrent modification. Regroup and batch calls, or retry later.\"\n    }\n}"}]},"settings":"","url":"/users/:userId","auth":"required"},"editedParams":true,"link_url":"","parentDoc":null,"project":"5626303ed0f87e190014c548","sync_unique":"","body":"","excerpt":"Fully update or create a user","next":{"description":"","pages":[]},"updates":[],"user":"56262ffad0f87e190014c547","childrenPages":[]}

put/users/:userId

Fully update or create a user

Path Params

userId:
required
string
Id of the user.

Body Params

body:
required
object
JSON body

User Information

Try It Out

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

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"576ba30f2f4daf0e00a62fea","link_url":"","type":"get","category":"5763c690e3e44d0e000a4d41","editedParams2":true,"hidden":false,"editedParams":true,"order":16,"slug":"get-events","sync_unique":"","updates":[],"api":{"method":"get","params":[{"default":"","type":"string","name":"userId","in":"query","_id":"576ba30f2f4daf0e00a62ff4","ref":"","required":false,"desc":"The userId of the events to list. Give an empty value for null. Omit the parameter not to filter."},{"in":"query","_id":"576ba30f2f4daf0e00a62ff3","ref":"","required":false,"desc":"The installationId of the events to list. You can alternatively use the device platform and device id joined by a colon. Note that an installationId is not a random string and is always used in pair with its associated userId, which you must provide in the userId parameter.","default":"","type":"string","name":"installationId"},{"ref":"","required":false,"desc":"Comma separated list of fields to return.","default":"","type":"array_string","name":"fields","in":"query","_id":"576ba30f2f4daf0e00a62ff2"},{"required":false,"desc":"The number of first results to skip. Ignored when no sorting is provided. For an efficient deep pagination, always start at 0.","default":"0","type":"int","name":"offset","in":"query","_id":"576ba30f2f4daf0e00a62ff1","ref":""},{"desc":"The number of results to return. This number may be adjusted for efficient deep paginations. The actual number of results may be less for the last few pages of an efficient deep pagination.","default":"50","type":"int","name":"limit","in":"query","_id":"576ba30f2f4daf0e00a62ff0","ref":"","required":false},{"ref":"","required":false,"desc":"The cursor identifier for fetching the next result page. You should always use the whole URL provided in the pagination.next field of the previous request response. Do not try to reuse this identifier if changing the other parameters, as it is bound to them.","default":"","type":"string","name":"next","in":"query","_id":"576ba30f2f4daf0e00a62fef"},{"type":"string","name":"sort","in":"query","_id":"576ba30f2f4daf0e00a62fee","ref":"","required":false,"desc":"How to sort the results. You can sort on multiple fields. For efficient deep pagination, you should use \"none\". Eg.: \"-creationDate\" will give you the most recent events, \"installationId,creationDate\" will list the events in chronological order, one installation after an other.","default":"none"},{"type":"array_string","name":"types","in":"query","_id":"576ba30f2f4daf0e00a62fed","ref":"","required":false,"desc":"The types of the events to list.","default":""},{"required":false,"desc":"The minimum creationDate of the events to list.","default":"","type":"string","name":"creationDateFrom","in":"query","_id":"576ba30f2f4daf0e00a62fec","ref":""},{"desc":"The maximum creationDate of the events to list.","default":"","type":"string","name":"creationDateTo","in":"query","_id":"576ba30f2f4daf0e00a62feb","ref":"","required":false}],"results":{"codes":[{"code":"{\n  \"count\": 123,\n  \"data\": [\n    {\n      \"id\": \"01b7ygh649tx6xx0\",\n      \"applicationId\": \"01906i1feoq2cu1p\",\n      \"creationDate\": 1451648096393,\n      \"actionDate\": 1451648095826,\n      \"userId\": null,\n      \"installationId\": \"eb5c4901cfab8836b2bf806ca1c8ade1fccd3fa7\",\n      \"type\": \"@NOTIFICATION_OPENED\",\n      \"campaignId\": \"01a7u400ksbd4gs2\",\n      \"notificationId\": \"01a7u400msep6gb2\",\n      \"location\": {\n        \"lat\": 45.12916867,\n        \"lon\": 7.4065894\n      }\n    },\n    //...\n  ],\n  \"pagination\": {\n    \"previous\": null,\n    \"next\": \"https://api.wonderpush.com/v1/management/events?accessToken=YOUR_APPLICATION_ACCESS_TOKEN&limit=50&pretty=0&applicationId=01906i1feoq2cu1p&next=0GwZy6UsvjVdYTT59ChWqcr14HeMLmYrpKi3SfR8ilMYmr5xKxgL9HU5fpNSLCfXQPyicvW766zImO7qu_CyWfZuJXm0oR1No5yRyPcAPllNTc0dma4H5xnqhKXDbswsK8J-H9f5Wipufzpi1AihZr7rNoXXnBv43wmDM6pxbNo\"\n  }\n}","name":"","status":200,"language":"json"},{"name":"","status":400,"language":"json","code":"{}"}]},"settings":"","url":"/events","auth":"required","examples":{"codes":[{"language":"curl","code":"curl -XGET https://api.wonderpush.com/v1/management/events \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN"}]}},"createdAt":"2016-06-23T08:51:27.461Z","excerpt":"Fetch events","project":"5626303ed0f87e190014c548","link_external":false,"parentDoc":null,"title":"/events","user":"56262ffad0f87e190014c547","__v":1,"body":"Search and list events. This calls enables you to export all events, or only a subset of them. You can filter by user, installation, or event type, and restrict results from a given time window. For efficient deep pagination, you must use `sort=none`, using a large offset is highly discouraged.\n\nThe result is comprised of a `data` array, and a `pagination` object containing `previous` and `next`, two complete URLs for navigating through the result set. Always use the URLs as is and do not add or remove parameters. When doing efficient deep pagination, only the `pagination.next` page is available.","githubsync":"","isReference":true,"version":"5626303fd0f87e190014c54b","next":{"description":"","pages":[]},"childrenPages":[]}

get/events

Fetch events

Query Params

userId:
string
The userId of the events to list. Give an empty value for null. Omit the parameter not to filter.
installationId:
string
The installationId of the events to list. You can alternatively use the device platform and device id joined by a colon. Note that an installationId is not a random string and is always used in pair with its associated userId, which you must provide in the userId parameter.
fields:
array of strings
Comma separated list of fields to return.
offset:
integer0
The number of first results to skip. Ignored when no sorting is provided. For an efficient deep pagination, always start at 0.
limit:
integer50
The number of results to return. This number may be adjusted for efficient deep paginations. The actual number of results may be less for the last few pages of an efficient deep pagination.
next:
string
The cursor identifier for fetching the next result page. You should always use the whole URL provided in the pagination.next field of the previous request response. Do not try to reuse this identifier if changing the other parameters, as it is bound to them.
sort:
stringnone
How to sort the results. You can sort on multiple fields. For efficient deep pagination, you should use "none". Eg.: "-creationDate" will give you the most recent events, "installationId,creationDate" will list the events in chronological order, one installation after an other.
types:
array of strings
The types of the events to list.
creationDateFrom:
string
The minimum creationDate of the events to list.
creationDateTo:
string
The maximum creationDate of the events to list.
Search and list events. This calls enables you to export all events, or only a subset of them. You can filter by user, installation, or event type, and restrict results from a given time window. For efficient deep pagination, you must use `sort=none`, using a large offset is highly discouraged. The result is comprised of a `data` array, and a `pagination` object containing `previous` and `next`, two complete URLs for navigating through the result set. Always use the URLs as is and do not add or remove parameters. When doing efficient deep pagination, only the `pagination.next` page is available.

User Information

Try It Out

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

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Search and list events. This calls enables you to export all events, or only a subset of them. You can filter by user, installation, or event type, and restrict results from a given time window. For efficient deep pagination, you must use `sort=none`, using a large offset is highly discouraged. The result is comprised of a `data` array, and a `pagination` object containing `previous` and `next`, two complete URLs for navigating through the result set. Always use the URLs as is and do not add or remove parameters. When doing efficient deep pagination, only the `pagination.next` page is available.
{"_id":"576ba4956c24681700c900fb","link_url":"","project":"5626303ed0f87e190014c548","sync_unique":"","api":{"url":"/events","auth":"required","examples":{"codes":[{"language":"curl","code":"curl -XPOST https://api.wonderpush.com/v1/management/events \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN \\\n    -d userId= \\\n    -d installationId=bfbd475402abf833c226a7144ad9f7cb45629abc \\\n    -d body='{\"type\":\"product_shipped\",\"custom\":{\"string_productName\":\"Stuff-O-Matic 3000\"}}'"}]},"method":"post","params":[{"ref":"","required":true,"desc":"Id of the associated user. Leave empty for null.","default":"","type":"string","name":"userId","in":"body","_id":"576b99e4a478d417005b0b40"},{"required":true,"desc":"Id of an installation if you know it, or alternatively the device platform and device id joined by a colon. Note that an installationId is not a random string and is always used in pair with its associated userId, which you must provide in the userId parameter.","default":"","type":"string","name":"installationId","in":"body","_id":"576b99e4a478d417005b0b3f","ref":""},{"desc":"JSON body with at least the `type` string field.","default":"","type":"object","name":"body","in":"body","_id":"576b99e4a478d417005b0b3e","ref":"","required":true}],"results":{"codes":[{"name":"","status":200,"language":"json","code":"{\"success\":true}"},{"language":"json","code":"{\n    \"error\": {\n        \"status\": 400,\n        \"code\": \"10002\",\n        \"message\": \"Missing parameter userId\"\n    }\n}","name":"","status":400}]},"settings":""},"body":"*(BETA)*\n\nThis end-point permits you to add events to an installation timeline from your backend. This way, the application or website SDK does need to perform it itself.","createdAt":"2016-06-23T08:57:57.119Z","editedParams":true,"slug":"post-events","type":"post","updates":[],"__v":1,"category":"5763c690e3e44d0e000a4d41","isReference":true,"user":"56262ffad0f87e190014c547","excerpt":"Track an application event","hidden":false,"next":{"description":"","pages":[]},"title":"/events","parentDoc":null,"version":"5626303fd0f87e190014c54b","editedParams2":true,"githubsync":"","link_external":false,"order":17,"childrenPages":[]}

post/events

Track an application event

Body Params

userId:
required
string
Id of the associated user. Leave empty for null.
installationId:
required
string
Id of an installation if you know it, or alternatively the device platform and device id joined by a colon. Note that an installationId is not a random string and is always used in pair with its associated userId, which you must provide in the userId parameter.
body:
required
object
JSON body with at least the `type` string field.
*(BETA)* This end-point permits you to add events to an installation timeline from your backend. This way, the application or website SDK does need to perform it itself.

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 }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



*(BETA)* This end-point permits you to add events to an installation timeline from your backend. This way, the application or website SDK does need to perform it itself.
{"_id":"5808db52bfafa20f0097dbec","link_external":false,"project":"5626303ed0f87e190014c548","slug":"get-notifications","__v":1,"isReference":true,"excerpt":"Fetch notifications","link_url":"","updates":[],"body":"Search and list notifications. This calls enables you to export all notifications, or only a subset of them. You can filter by user and restrict results from a given time window. For efficient deep pagination, you must use `sort=none`, using a large offset is highly discouraged.\n\nThe result is comprised of a `data` array, and a `pagination` object containing `previous` and `next`, two complete URLs for navigating through the result set. Always use the URLs as is and do not add or remove parameters. When doing efficient deep pagination, only the `pagination.next` page is available.","order":18,"sync_unique":"","user":"56262ffad0f87e190014c547","version":"5626303fd0f87e190014c54b","createdAt":"2016-10-20T14:57:22.995Z","githubsync":"","hidden":false,"parentDoc":null,"title":"/notifications","type":"get","api":{"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"count\": 123,\n  \"data\": [\n    {\n      \"id\": \"01aty6boilx1jqo3\",\n      \"applicationId\": \"01906i1feoq2cu1p\",\n      \"creationDate\": 1474992366165,\n      \"updateDate\": 1474992366165,\n      \"alert\": {\n        \"text\": \"Hello, WonderPush!\"\n      }\n    },\n    //...\n  ],\n  \"pagination\": {\n    \"previous\": null,\n    \"next\": \"https://api.wonderpush.com/v1/management/notifications?accessToken=YOUR_APPLICATION_ACCESS_TOKEN&limit=50&pretty=0&applicationId=01906i1feoq2cu1p&next=0GwZy6UsvjVdYTT59ChWqcr14HeMLmYrpKi3SfR8ilMYmr5xKxgL9HU5fpNSLCfXQPyicvW766zImO7qu_CyWfZuJXm0oR1No5yRyPcAPllNTc0dma4H5xnqhKXDbswsK8J-H9f5Wipufzpi1AihZr7rNoXXnBv43wmDM6pxbNo\"\n  }\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"/notifications","auth":"required","examples":{"codes":[{"language":"curl","code":"curl -XGET https://api.wonderpush.com/v1/management/notifications \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN"}]},"method":"get","params":[{"_id":"576ba30f2f4daf0e00a62ff2","ref":"","in":"query","required":false,"desc":"Comma separated list of fields to return.","default":"","type":"array_string","name":"fields"},{"name":"offset","_id":"576ba30f2f4daf0e00a62ff1","ref":"","in":"query","required":false,"desc":"The number of first results to skip. Ignored when no sorting is provided. For an efficient deep pagination, always start at 0.","default":"0","type":"int"},{"ref":"","in":"query","required":false,"desc":"The number of results to return. This number may be adjusted for efficient deep paginations. The actual number of results may be less for the last few pages of an efficient deep pagination.","default":"50","type":"int","name":"limit","_id":"576ba30f2f4daf0e00a62ff0"},{"default":"","type":"string","name":"next","_id":"576ba30f2f4daf0e00a62fef","ref":"","in":"query","required":false,"desc":"The cursor identifier for fetching the next result page. You should always use the whole URL provided in the pagination.next field of the previous request response. Do not try to reuse this identifier if changing the other parameters, as it is bound to them."},{"in":"query","required":false,"desc":"How to sort the results. You can sort on multiple fields. For efficient deep pagination, you should use \"none\". Eg.: \"-creationDate\" will give you the most recent notifications.","default":"none","type":"string","name":"sort","_id":"576ba30f2f4daf0e00a62fee","ref":""},{"desc":"The minimum creationDate of the notifications to list.","default":"","type":"string","name":"creationDateFrom","_id":"576ba30f2f4daf0e00a62fec","ref":"","in":"query","required":false},{"name":"creationDateTo","_id":"576ba30f2f4daf0e00a62feb","ref":"","in":"query","required":false,"desc":"The maximum creationDate of the notifications to list.","default":"","type":"string"},{"type":"string","name":"updateDateFrom","_id":"57f7a82c3ae2bf170084b75d","ref":"","in":"query","required":false,"desc":"The minimum updateDate of the notifications to list.","default":""},{"desc":"The maximum updateDate of the notifications to list.","default":"","type":"string","name":"updateDateTo","_id":"57f7a82c3ae2bf170084b75c","ref":"","in":"query","required":false}]},"category":"5763c690e3e44d0e000a4d41","next":{"description":"","pages":[]},"childrenPages":[]}

get/notifications

Fetch notifications

Query Params

fields:
array of strings
Comma separated list of fields to return.
offset:
integer0
The number of first results to skip. Ignored when no sorting is provided. For an efficient deep pagination, always start at 0.
limit:
integer50
The number of results to return. This number may be adjusted for efficient deep paginations. The actual number of results may be less for the last few pages of an efficient deep pagination.
next:
string
The cursor identifier for fetching the next result page. You should always use the whole URL provided in the pagination.next field of the previous request response. Do not try to reuse this identifier if changing the other parameters, as it is bound to them.
sort:
stringnone
How to sort the results. You can sort on multiple fields. For efficient deep pagination, you should use "none". Eg.: "-creationDate" will give you the most recent notifications.
creationDateFrom:
string
The minimum creationDate of the notifications to list.
creationDateTo:
string
The maximum creationDate of the notifications to list.
updateDateFrom:
string
The minimum updateDate of the notifications to list.
updateDateTo:
string
The maximum updateDate of the notifications to list.
Search and list notifications. This calls enables you to export all notifications, or only a subset of them. You can filter by user and restrict results from a given time window. For efficient deep pagination, you must use `sort=none`, using a large offset is highly discouraged. The result is comprised of a `data` array, and a `pagination` object containing `previous` and `next`, two complete URLs for navigating through the result set. Always use the URLs as is and do not add or remove parameters. When doing efficient deep pagination, only the `pagination.next` page is available.

User Information

Try It Out

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

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Search and list notifications. This calls enables you to export all notifications, or only a subset of them. You can filter by user and restrict results from a given time window. For efficient deep pagination, you must use `sort=none`, using a large offset is highly discouraged. The result is comprised of a `data` array, and a `pagination` object containing `previous` and `next`, two complete URLs for navigating through the result set. Always use the URLs as is and do not add or remove parameters. When doing efficient deep pagination, only the `pagination.next` page is available.
{"_id":"5808dc63b2524d0f003506ae","slug":"get-notifications-notificationid","title":"/notifications/:notificationId","__v":1,"category":"5763c690e3e44d0e000a4d41","createdAt":"2016-10-20T15:01:55.658Z","link_url":"","next":{"pages":[],"description":""},"body":"","order":19,"project":"5626303ed0f87e190014c548","updates":[],"parentDoc":null,"version":"5626303fd0f87e190014c54b","excerpt":"Get a notification","githubsync":"","isReference":true,"link_external":false,"api":{"settings":"","url":"/notifications/:notificationId","auth":"required","examples":{"codes":[{"language":"curl","code":"curl -XGET https://api.wonderpush.com/v1/management/notification/01aty6boilx1jqo3 \\\n    -d accessToken=YOUR_APPLICATION_ACCESS_TOKEN"}]},"method":"get","params":[{"type":"string","name":"notificationId","_id":"576b992e2f4daf0e00a62ef0","ref":"","in":"path","required":true,"desc":"Id of the notification to retrieve.","default":""},{"desc":"Comma separated list of fields to return.","default":"","type":"array_string","name":"fields","_id":"576b992e2f4daf0e00a62eef","ref":"","in":"query","required":false}],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"id\": \"01aty6boilx1jqo3\",\n  \"applicationId\": \"01906i1feoq2cu1p\",\n  \"creationDate\": 1474992366165,\n  \"updateDate\": 1474992366165,\n  \"alert\": {\n    \"text\": \"Hello, WonderPush!\"\n  }\n}","name":""},{"status":404,"language":"json","code":"{\n    \"error\": {\n        \"status\": 404,\n        \"code\": \"12036\",\n        \"message\": \"Notification does not exist.\"\n    }\n}","name":""}]}},"hidden":false,"sync_unique":"","type":"get","user":"56262ffad0f87e190014c547","childrenPages":[]}

get/notifications/:notificationId

Get a notification

Path Params

notificationId:
required
string
Id of the notification to retrieve.

Query Params

fields:
array of strings
Comma separated list of fields to return.

User Information

Try It Out

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

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"_id":"5851285d5dbf4d0f006522d4","next":{"pages":[],"description":""},"sync_unique":"","type":"get","title":"/stats/events","updates":[],"githubsync":"","hidden":false,"project":"5626303ed0f87e190014c548","slug":"get-stats-events","version":"5626303fd0f87e190014c54b","__v":1,"api":{"settings":"","url":"/stats/events","auth":"required","examples":{"codes":[{"language":"curl","code":"curl -XGET https://api.wonderpush.com/v1/management/stats/events?accessToken=YOUR_APPLICATION_ACCESS_TOKEN"}]},"method":"get","params":[{"type":"datetime","name":"fromDate","_id":"5851285d5dbf4d0f006522dd","ref":"","in":"query","required":false,"desc":"The oldest date to return statistics for.","default":""},{"required":false,"desc":"The newest date to return statistics for. Defaults to _now_.","default":"","type":"datetime","name":"toDate","_id":"5851285d5dbf4d0f006522dc","ref":"","in":"query"},{"type":"string","name":"resolution","_id":"5851285d5dbf4d0f006522db","ref":"","in":"query","required":false,"desc":"Either `day` or `hour`. Returns statistics grouped day by day or hour by hour.","default":"day"},{"required":false,"desc":"How many days or hours since `fromDate` or until `toDate` to return. Maximum 30 days or 24 hours, which is the default.","default":"","type":"int","name":"interval","_id":"5851285d5dbf4d0f006522da","ref":"","in":"query"},{"ref":"","in":"query","required":false,"desc":"Comma-separated list of platforms to return. Accepts `@ALL` and `@EACH`.","default":"","type":"array_string","name":"platforms","_id":"5851285d5dbf4d0f006522d9"},{"in":"query","required":false,"desc":"Comma-separated list of event types to return. Accepts `@EACH`.","default":"","type":"array_string","name":"types","_id":"5851285d5dbf4d0f006522d8","ref":""},{"required":false,"desc":"Comma-separated list of campaignIds to return. Accepts `@ALL` and `@EACH`. Use `@NONE` to select campaign statistics that were not bond to any particular campaignId (aka. _null campaignId_).","default":"","type":"array_string","name":"campaignIds","_id":"5851285d5dbf4d0f006522d7","ref":"","in":"query"},{"ref":"","in":"query","required":false,"desc":"Comma-separated list of notificationIds to return. Accepts `@ALL` and `@EACH`. The special value `@1` regroups all notifications send directly to a single recipient.","default":"","type":"array_string","name":"notificationIds","_id":"5851285d5dbf4d0f006522d6"},{"in":"query","required":false,"desc":"Comma-separated list of button labels to return. If your button label contains a comma, send your request using a JSON body instead. Accepts `@ALL` and `@EACH`.","default":"","type":"array_string","name":"buttonLabels","_id":"5851285d5dbf4d0f006522d5","ref":""},{"ref":"","in":"query","required":false,"desc":"Either `json` or `csv`.","default":"json","type":"string","name":"format","_id":"58a4c0a589e3232300e5c486"},{"in":"query","required":false,"desc":"One of `counters`, `platforms`, `types`, `campaignIds`, `notificationIds` and `buttonLabels`. Change the output from a list of counters grouped inside date objects, to list of data points style. See below for more information.","default":"","type":"string","name":"flatten","_id":"58a4c0a589e3232300e5c485","ref":""},{"required":false,"desc":"To avoid name clashes when transforming your custom event types into fields you can prefix them. If you give a value ending with a dot, then the JSON output will put the values as subfields of the given field name. See below for more information.","default":"","type":"string","name":"flattenPrefix","_id":"58a4c0a589e3232300e5c484","ref":"","in":"query"},{"ref":"","in":"query","required":false,"desc":"Whether to ensure that no dates are missing (if no counters inside it are nonzero), and every data point contains the same fields when flattening the output.","default":"false","type":"boolean","name":"addZero","_id":"58a4c0a589e3232300e5c483"},{"default":"CRLF","type":"string","name":"csvEol","_id":"58a4c0a589e3232300e5c482","ref":"","in":"query","required":false,"desc":"One of `CR`, `LF` and `CRLF`. What line ending flavor to use for the CSV output."},{"in":"query","required":false,"desc":"What field separator to use. Some tools might expect `;`.","default":",","type":"string","name":"csvSeparator","_id":"58a4c0a589e3232300e5c481","ref":""},{"desc":"What styles of quotes to use. You can use an empty value to disable quoting string fields, but you might experience corrupted output.","default":"\"","type":"string","name":"csvQuotes","_id":"58a4c0a589e3232300e5c480","ref":"","in":"query","required":false}],"results":{"codes":[{"name":"","code":"{\n  \"data\": [\n    {\n      \"date\": 1479168000000,\n      \"dateISO8601\": \"2016-11-15T00:00:00.000+00:00\",\n      \"campaignId\": \"@ALL\",\n      \"campaignName\": \"@ALL\",\n      \"counters\": [\n        {\n          \"type\": \"@NOTIFICATION_SENT\",\n          \"count\": 79\n        },\n        {\n          \"type\": \"@NOTIFICATION_SENT\",\n          \"platform\": \"Android\",\n          \"count\": 42\n        },\n        {\n          \"type\": \"@NOTIFICATION_SENT\",\n          \"platform\": \"iOS\",\n          \"count\": 37\n        },\n        …\n      ]\n    },\n    …\n  ]\n}","language":"json","status":200},{"code":"{}","language":"json","status":400,"name":""},{"status":200,"name":"flatten=counters","code":"{\n  \"data\": [\n    {\n      \"date\": 1479168000000,\n      \"dateISO8601\": \"2016-11-15T00:00:00.000+00:00\",\n      \"campaignId\": \"@ALL\",\n      \"campaignName\": \"@ALL\",\n      \"type\": \"@NOTIFICATION_SENT\",\n      \"count\": 79\n    },\n    {\n      \"date\": 1479168000000,\n      \"dateISO8601\": \"2016-11-15T00:00:00.000+00:00\",\n      \"campaignId\": \"@ALL\",\n      \"campaignName\": \"@ALL\",\n      \"type\": \"@NOTIFICATION_SENT\",\n      \"platform\": \"Android\",\n      \"count\": 42\n    },\n    {\n      \"date\": 1479168000000,\n      \"dateISO8601\": \"2016-11-15T00:00:00.000+00:00\",\n      \"campaignId\": \"@ALL\",\n      \"campaignName\": \"@ALL\",\n      \"type\": \"@NOTIFICATION_SENT\",\n      \"platform\": \"iOS\",\n      \"count\": 37\n    },\n    …\n  ]\n}","language":"json"},{"code":"{\n  \"data\": [\n    {\n      \"date\": 1479168000000,\n      \"dateISO8601\": \"2016-11-15T00:00:00.000+00:00\",\n      \"campaignId\": \"@ALL\",\n      \"campaignName\": \"@ALL\",\n      \"type\": \"@NOTIFICATION_SENT\",\n      \"@ALL\": 79\n      \"Android\": 42\n      \"iOS\": 37\n    },\n    …\n  ]\n}","language":"json","status":200,"name":"flatten=platforms"}]}},"body":"Return statistics collected about various events, by event type, platform, campaign, etc.\nUsing `@ALL` will return statistics across, say, platforms.\nUsing `@EACH` will return statistics for each, say, platform.\nYou can also ask for a single or a subset of values, like for example `platforms=Android,Web`.\n\nThis API returns data with 3 different level of detail:\n\n* Global statistics, when `campaignIds=@ALL` which is the default.\n* Statistics for each campaign, when `campaignIds=@EACH` or when filtering against more than one campaign at a time.\n* Detailed statistics by notification for a single campaign, when using `campaignIds=aSingleCampaignId`.\n\n`@EACH` can only be combined with `@ALL`, when you want to combine statistics, say, across all platforms, as well as to have the detail platform by platform.\nBy default, the API defaults to `@ALL,@EACH`. Only event `types` cannot be combined using `@ALL` as if would make little sense to add app opens to notifications sent.\n\nThe default output format groups counters into per-date objects as shown below:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"data\\\": [\\n    {\\n      \\\"date\\\": 1479168000000,\\n      \\\"dateISO8601\\\": \\\"2016-11-15T00:00:00.000+00:00\\\",\\n      \\\"campaignId\\\": \\\"@ALL\\\",\\n      \\\"campaignName\\\": \\\"@ALL\\\",\\n      \\\"counters\\\": [\\n        {\\n          \\\"type\\\": \\\"@NOTIFICATION_SENT\\\",\\n          \\\"count\\\": 79\\n        },\\n        {\\n          \\\"type\\\": \\\"@NOTIFICATION_SENT\\\",\\n          \\\"platform\\\": \\\"Android\\\",\\n          \\\"count\\\": 42\\n        },\\n        {\\n          \\\"type\\\": \\\"@NOTIFICATION_SENT\\\",\\n          \\\"platform\\\": \\\"iOS\\\",\\n          \\\"count\\\": 37\\n        },\\n        …\\n      ]\\n    },\\n    …\\n  ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"No flattening\"\n    }\n  ]\n}\n[/block]\nYou can also ask to merge the counters and date objects to yield what could be called *data points*:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"data\\\": [\\n    {\\n      \\\"date\\\": 1479168000000,\\n      \\\"dateISO8601\\\": \\\"2016-11-15T00:00:00.000+00:00\\\",\\n      \\\"campaignId\\\": \\\"@ALL\\\",\\n      \\\"campaignName\\\": \\\"@ALL\\\",\\n      \\\"type\\\": \\\"@NOTIFICATION_SENT\\\",\\n      \\\"count\\\": 79\\n    },\\n    {\\n      \\\"date\\\": 1479168000000,\\n      \\\"dateISO8601\\\": \\\"2016-11-15T00:00:00.000+00:00\\\",\\n      \\\"campaignId\\\": \\\"@ALL\\\",\\n      \\\"campaignName\\\": \\\"@ALL\\\",\\n      \\\"type\\\": \\\"@NOTIFICATION_SENT\\\",\\n      \\\"platform\\\": \\\"Android\\\",\\n      \\\"count\\\": 42\\n    },\\n    {\\n      \\\"date\\\": 1479168000000,\\n      \\\"dateISO8601\\\": \\\"2016-11-15T00:00:00.000+00:00\\\",\\n      \\\"campaignId\\\": \\\"@ALL\\\",\\n      \\\"campaignName\\\": \\\"@ALL\\\",\\n      \\\"type\\\": \\\"@NOTIFICATION_SENT\\\",\\n      \\\"platform\\\": \\\"iOS\\\",\\n      \\\"count\\\": 37\\n    },\\n    …\\n  ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"flatten=counters\"\n    }\n  ]\n}\n[/block]\nNote that you will have as many objects sharing the same date as we had counters within the per-date object previously.\n\nLet's say you are only interested in `@NOTIFICATION_SENT` events and want a single object per date, with a platform break-down. This is easily done by using both `types=@NOTIFICATION_SENT` and `flatten=platforms`:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"data\\\": [\\n    {\\n      \\\"date\\\": 1479168000000,\\n      \\\"dateISO8601\\\": \\\"2016-11-15T00:00:00.000+00:00\\\",\\n      \\\"campaignId\\\": \\\"@ALL\\\",\\n      \\\"campaignName\\\": \\\"@ALL\\\",\\n      \\\"type\\\": \\\"@NOTIFICATION_SENT\\\",\\n      \\\"@ALL\\\": 79,\\n      \\\"Android\\\": 42,\\n      \\\"iOS\\\": 37\\n    },\\n    {\\n      \\\"date\\\": 1479254400000,\\n      \\\"dateISO8601\\\": \\\"2016-11-16T00:00:00.000+00:00\\\",\\n      \\\"campaignId\\\": \\\"@ALL\\\",\\n      \\\"campaignName\\\": \\\"@ALL\\\",\\n      \\\"type\\\": \\\"@NOTIFICATION_SENT\\\",\\n      \\\"@ALL\\\": 61,\\n      \\\"Android\\\": 34,\\n      \\\"iOS\\\": 27\\n    },\\n    …\\n  ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"types=@NOTIFICATION_SENT&flatten=platforms\"\n    }\n  ]\n}\n[/block]\nNote how the `count` field disappeared and the different values of `platform` have been changed into fields.\n\nIf you had not controlled the types to return, you would have gotten one object per date and per type, like we had in the previous example with the platforms.\n\nIn order to avoid name clashes (especially with custom event names) and to help better identify the counter fields, you can use a prefix.\nHere is how the previous example would look by using `flattenPrefix=platform:`:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"data\\\": [\\n    {\\n      \\\"date\\\": 1479168000000,\\n      \\\"dateISO8601\\\": \\\"2016-11-15T00:00:00.000+00:00\\\",\\n      \\\"campaignId\\\": \\\"@ALL\\\",\\n      \\\"campaignName\\\": \\\"@ALL\\\",\\n      \\\"type\\\": \\\"@NOTIFICATION_SENT\\\",\\n      \\\"platform:@ALL\\\": 79,\\n      \\\"platform:Android\\\": 42,\\n      \\\"platform:iOS\\\": 37\\n    },\\n    {\\n      \\\"date\\\": 1479254400000,\\n      \\\"dateISO8601\\\": \\\"2016-11-16T00:00:00.000+00:00\\\",\\n      \\\"campaignId\\\": \\\"@ALL\\\",\\n      \\\"campaignName\\\": \\\"@ALL\\\",\\n      \\\"type\\\": \\\"@NOTIFICATION_SENT\\\",\\n      \\\"platform:@ALL\\\": 61,\\n      \\\"platform:Android\\\": 34,\\n      \\\"platform:iOS\\\": 27\\n    },\\n    …\\n  ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"types=@NOTIFICATION_SENT&flatten=platforms&flattenPrefix=platform:\"\n    }\n  ]\n}\n[/block]\nYou can also opt for a sub-object if you prefer by ending the prefix with a dot. Here is an example using `flattenPrefix=values.`:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"data\\\": [\\n    {\\n      \\\"date\\\": 1479168000000,\\n      \\\"dateISO8601\\\": \\\"2016-11-15T00:00:00.000+00:00\\\",\\n      \\\"campaignId\\\": \\\"@ALL\\\",\\n      \\\"campaignName\\\": \\\"@ALL\\\",\\n      \\\"type\\\": \\\"@NOTIFICATION_SENT\\\",\\n      \\\"values\\\": {\\n        \\\"@ALL\\\": 79,\\n        \\\"Android\\\": 42,\\n        \\\"iOS\\\": 37\\n      }\\n    },\\n    {\\n      \\\"date\\\": 1479254400000,\\n      \\\"dateISO8601\\\": \\\"2016-11-16T00:00:00.000+00:00\\\",\\n      \\\"campaignId\\\": \\\"@ALL\\\",\\n      \\\"campaignName\\\": \\\"@ALL\\\",\\n      \\\"type\\\": \\\"@NOTIFICATION_SENT\\\",\\n      \\\"values\\\": {\\n        \\\"@ALL\\\": 61,\\n        \\\"Android\\\": 34,\\n        \\\"iOS\\\": 27\\n      }\\n    },\\n    …\\n  ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"types=@NOTIFICATION_SENT&flatten=platforms&flattenPrefix=values.\"\n    }\n  ]\n}\n[/block]\nNote, we do not end-up with the default format here, there is no *array* of counters, but an object containing the flatten field's values as sub-fields and associated counts as values.\n\nThe `addZero` parameter will help you obtain a dense output. When a counter is 0, it is normally not even materialized into existence. The same is true if for a given date we have no counter. If using `addZero=true` we ensure that missing dates and counters are populated with 0s.\n\nThis leads us to the CSV format, controlled by using `format=csv`. CSV is a table-like format, it has a set of columns presented in the first row, and a list of rows that all have the same columns.\nWhen using the CSV format, you basically impose flattening (using `flatten=counters` by default) and `addZero=true`. The keys that would be present in the data-point objects in JSON are all collected and form the set of columns, presented in the first header line. Following are each data-point object.\nNote that if you did not sufficiently filtered the output (using `platforms=@ALL` for instance like before) you might have several lines for a given date.\n\nHere is how the first example would look in CSV:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\\"date\\\",\\\"dateISO8601\\\",\\\"campaignId\\\",\\\"campaignName\\\",\\\"type\\\",\\\"platform\\\",\\\"count\\\"\\n1479168000000,\\\"2016-11-15T00:00:00.000+00:00\\\",\\\"@ALL\\\",\\\"@ALL\\\",\\\"@NOTIFICATION_SENT\\\",\\\"@ALL\\\",79\\n1479168000000,\\\"2016-11-15T00:00:00.000+00:00\\\",\\\"@ALL\\\",\\\"@ALL\\\",\\\"@NOTIFICATION_SENT\\\",\\\"Android\\\",42\\n1479168000000,\\\"2016-11-15T00:00:00.000+00:00\\\",\\\"@ALL\\\",\\\"@ALL\\\",\\\"@NOTIFICATION_SENT\\\",\\\"iOS\\\",37\\n…\",\n      \"language\": \"text\",\n      \"name\": \"format=csv\"\n    }\n  ]\n}\n[/block]\nAnd here is how it would look in CSV by with `types=@NOTIFICATION_SENT` and `flatten=platforms` like a later example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\\"date\\\",\\\"dateISO8601\\\",\\\"campaignId\\\",\\\"campaignName\\\",\\\"type\\\",\\\"@ALL\\\",\\\"Android\\\",\\\"iOS\\\"\\n1479168000000,\\\"2016-11-15T00:00:00.000+00:00\\\",\\\"@ALL\\\",\\\"@ALL\\\",\\\"@NOTIFICATION_SENT\\\",79,42,37\\n1479254400000,\\\"2016-11-16T00:00:00.000+00:00\\\",\\\"@ALL\\\",\\\"@ALL\\\",\\\"@NOTIFICATION_SENT\\\",61,34,27\\n…\",\n      \"language\": \"text\",\n      \"name\": \"format=csv&types=@NOTIFICATION_SENT&flatten=platforms\"\n    }\n  ]\n}\n[/block]","category":"5763c690e3e44d0e000a4d41","link_external":false,"user":"56262ffad0f87e190014c547","createdAt":"2016-12-14T11:09:17.943Z","excerpt":"Read event-related statistics.","isReference":true,"link_url":"","order":20,"parentDoc":null,"childrenPages":[]}

get/stats/events

Read event-related statistics.

Query Params

fromDate:
datetime
The oldest date to return statistics for.
toDate:
datetime
The newest date to return statistics for. Defaults to _now_.
resolution:
stringday
Either `day` or `hour`. Returns statistics grouped day by day or hour by hour.
interval:
integer
How many days or hours since `fromDate` or until `toDate` to return. Maximum 30 days or 24 hours, which is the default.
platforms:
array of strings
Comma-separated list of platforms to return. Accepts `@ALL` and `@EACH`.
types:
array of strings
Comma-separated list of event types to return. Accepts `@EACH`.
campaignIds:
array of strings
Comma-separated list of campaignIds to return. Accepts `@ALL` and `@EACH`. Use `@NONE` to select campaign statistics that were not bond to any particular campaignId (aka. _null campaignId_).
notificationIds:
array of strings
Comma-separated list of notificationIds to return. Accepts `@ALL` and `@EACH`. The special value `@1` regroups all notifications send directly to a single recipient.
buttonLabels:
array of strings
Comma-separated list of button labels to return. If your button label contains a comma, send your request using a JSON body instead. Accepts `@ALL` and `@EACH`.
format:
stringjson
Either `json` or `csv`.
flatten:
string
One of `counters`, `platforms`, `types`, `campaignIds`, `notificationIds` and `buttonLabels`. Change the output from a list of counters grouped inside date objects, to list of data points style. See below for more information.
flattenPrefix:
string
To avoid name clashes when transforming your custom event types into fields you can prefix them. If you give a value ending with a dot, then the JSON output will put the values as subfields of the given field name. See below for more information.
addZero:
booleanfalse
Whether to ensure that no dates are missing (if no counters inside it are nonzero), and every data point contains the same fields when flattening the output.
csvEol:
stringCRLF
One of `CR`, `LF` and `CRLF`. What line ending flavor to use for the CSV output.
csvSeparator:
string,
What field separator to use. Some tools might expect `;`.
csvQuotes:
string"
What styles of quotes to use. You can use an empty value to disable quoting string fields, but you might experience corrupted output.
Return statistics collected about various events, by event type, platform, campaign, etc. Using `@ALL` will return statistics across, say, platforms. Using `@EACH` will return statistics for each, say, platform. You can also ask for a single or a subset of values, like for example `platforms=Android,Web`. This API returns data with 3 different level of detail: * Global statistics, when `campaignIds=@ALL` which is the default. * Statistics for each campaign, when `campaignIds=@EACH` or when filtering against more than one campaign at a time. * Detailed statistics by notification for a single campaign, when using `campaignIds=aSingleCampaignId`. `@EACH` can only be combined with `@ALL`, when you want to combine statistics, say, across all platforms, as well as to have the detail platform by platform. By default, the API defaults to `@ALL,@EACH`. Only event `types` cannot be combined using `@ALL` as if would make little sense to add app opens to notifications sent. The default output format groups counters into per-date objects as shown below: [block:code] { "codes": [ { "code": "{\n \"data\": [\n {\n \"date\": 1479168000000,\n \"dateISO8601\": \"2016-11-15T00:00:00.000+00:00\",\n \"campaignId\": \"@ALL\",\n \"campaignName\": \"@ALL\",\n \"counters\": [\n {\n \"type\": \"@NOTIFICATION_SENT\",\n \"count\": 79\n },\n {\n \"type\": \"@NOTIFICATION_SENT\",\n \"platform\": \"Android\",\n \"count\": 42\n },\n {\n \"type\": \"@NOTIFICATION_SENT\",\n \"platform\": \"iOS\",\n \"count\": 37\n },\n …\n ]\n },\n …\n ]\n}", "language": "json", "name": "No flattening" } ] } [/block] You can also ask to merge the counters and date objects to yield what could be called *data points*: [block:code] { "codes": [ { "code": "{\n \"data\": [\n {\n \"date\": 1479168000000,\n \"dateISO8601\": \"2016-11-15T00:00:00.000+00:00\",\n \"campaignId\": \"@ALL\",\n \"campaignName\": \"@ALL\",\n \"type\": \"@NOTIFICATION_SENT\",\n \"count\": 79\n },\n {\n \"date\": 1479168000000,\n \"dateISO8601\": \"2016-11-15T00:00:00.000+00:00\",\n \"campaignId\": \"@ALL\",\n \"campaignName\": \"@ALL\",\n \"type\": \"@NOTIFICATION_SENT\",\n \"platform\": \"Android\",\n \"count\": 42\n },\n {\n \"date\": 1479168000000,\n \"dateISO8601\": \"2016-11-15T00:00:00.000+00:00\",\n \"campaignId\": \"@ALL\",\n \"campaignName\": \"@ALL\",\n \"type\": \"@NOTIFICATION_SENT\",\n \"platform\": \"iOS\",\n \"count\": 37\n },\n …\n ]\n}", "language": "json", "name": "flatten=counters" } ] } [/block] Note that you will have as many objects sharing the same date as we had counters within the per-date object previously. Let's say you are only interested in `@NOTIFICATION_SENT` events and want a single object per date, with a platform break-down. This is easily done by using both `types=@NOTIFICATION_SENT` and `flatten=platforms`: [block:code] { "codes": [ { "code": "{\n \"data\": [\n {\n \"date\": 1479168000000,\n \"dateISO8601\": \"2016-11-15T00:00:00.000+00:00\",\n \"campaignId\": \"@ALL\",\n \"campaignName\": \"@ALL\",\n \"type\": \"@NOTIFICATION_SENT\",\n \"@ALL\": 79,\n \"Android\": 42,\n \"iOS\": 37\n },\n {\n \"date\": 1479254400000,\n \"dateISO8601\": \"2016-11-16T00:00:00.000+00:00\",\n \"campaignId\": \"@ALL\",\n \"campaignName\": \"@ALL\",\n \"type\": \"@NOTIFICATION_SENT\",\n \"@ALL\": 61,\n \"Android\": 34,\n \"iOS\": 27\n },\n …\n ]\n}", "language": "json", "name": "types=@NOTIFICATION_SENT&flatten=platforms" } ] } [/block] Note how the `count` field disappeared and the different values of `platform` have been changed into fields. If you had not controlled the types to return, you would have gotten one object per date and per type, like we had in the previous example with the platforms. In order to avoid name clashes (especially with custom event names) and to help better identify the counter fields, you can use a prefix. Here is how the previous example would look by using `flattenPrefix=platform:`: [block:code] { "codes": [ { "code": "{\n \"data\": [\n {\n \"date\": 1479168000000,\n \"dateISO8601\": \"2016-11-15T00:00:00.000+00:00\",\n \"campaignId\": \"@ALL\",\n \"campaignName\": \"@ALL\",\n \"type\": \"@NOTIFICATION_SENT\",\n \"platform:@ALL\": 79,\n \"platform:Android\": 42,\n \"platform:iOS\": 37\n },\n {\n \"date\": 1479254400000,\n \"dateISO8601\": \"2016-11-16T00:00:00.000+00:00\",\n \"campaignId\": \"@ALL\",\n \"campaignName\": \"@ALL\",\n \"type\": \"@NOTIFICATION_SENT\",\n \"platform:@ALL\": 61,\n \"platform:Android\": 34,\n \"platform:iOS\": 27\n },\n …\n ]\n}", "language": "json", "name": "types=@NOTIFICATION_SENT&flatten=platforms&flattenPrefix=platform:" } ] } [/block] You can also opt for a sub-object if you prefer by ending the prefix with a dot. Here is an example using `flattenPrefix=values.`: [block:code] { "codes": [ { "code": "{\n \"data\": [\n {\n \"date\": 1479168000000,\n \"dateISO8601\": \"2016-11-15T00:00:00.000+00:00\",\n \"campaignId\": \"@ALL\",\n \"campaignName\": \"@ALL\",\n \"type\": \"@NOTIFICATION_SENT\",\n \"values\": {\n \"@ALL\": 79,\n \"Android\": 42,\n \"iOS\": 37\n }\n },\n {\n \"date\": 1479254400000,\n \"dateISO8601\": \"2016-11-16T00:00:00.000+00:00\",\n \"campaignId\": \"@ALL\",\n \"campaignName\": \"@ALL\",\n \"type\": \"@NOTIFICATION_SENT\",\n \"values\": {\n \"@ALL\": 61,\n \"Android\": 34,\n \"iOS\": 27\n }\n },\n …\n ]\n}", "language": "json", "name": "types=@NOTIFICATION_SENT&flatten=platforms&flattenPrefix=values." } ] } [/block] Note, we do not end-up with the default format here, there is no *array* of counters, but an object containing the flatten field's values as sub-fields and associated counts as values. The `addZero` parameter will help you obtain a dense output. When a counter is 0, it is normally not even materialized into existence. The same is true if for a given date we have no counter. If using `addZero=true` we ensure that missing dates and counters are populated with 0s. This leads us to the CSV format, controlled by using `format=csv`. CSV is a table-like format, it has a set of columns presented in the first row, and a list of rows that all have the same columns. When using the CSV format, you basically impose flattening (using `flatten=counters` by default) and `addZero=true`. The keys that would be present in the data-point objects in JSON are all collected and form the set of columns, presented in the first header line. Following are each data-point object. Note that if you did not sufficiently filtered the output (using `platforms=@ALL` for instance like before) you might have several lines for a given date. Here is how the first example would look in CSV: [block:code] { "codes": [ { "code": "\"date\",\"dateISO8601\",\"campaignId\",\"campaignName\",\"type\",\"platform\",\"count\"\n1479168000000,\"2016-11-15T00:00:00.000+00:00\",\"@ALL\",\"@ALL\",\"@NOTIFICATION_SENT\",\"@ALL\",79\n1479168000000,\"2016-11-15T00:00:00.000+00:00\",\"@ALL\",\"@ALL\",\"@NOTIFICATION_SENT\",\"Android\",42\n1479168000000,\"2016-11-15T00:00:00.000+00:00\",\"@ALL\",\"@ALL\",\"@NOTIFICATION_SENT\",\"iOS\",37\n…", "language": "text", "name": "format=csv" } ] } [/block] And here is how it would look in CSV by with `types=@NOTIFICATION_SENT` and `flatten=platforms` like a later example: [block:code] { "codes": [ { "code": "\"date\",\"dateISO8601\",\"campaignId\",\"campaignName\",\"type\",\"@ALL\",\"Android\",\"iOS\"\n1479168000000,\"2016-11-15T00:00:00.000+00:00\",\"@ALL\",\"@ALL\",\"@NOTIFICATION_SENT\",79,42,37\n1479254400000,\"2016-11-16T00:00:00.000+00:00\",\"@ALL\",\"@ALL\",\"@NOTIFICATION_SENT\",61,34,27\n…", "language": "text", "name": "format=csv&types=@NOTIFICATION_SENT&flatten=platforms" } ] } [/block]

User Information

Try It Out

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

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return statistics collected about various events, by event type, platform, campaign, etc. Using `@ALL` will return statistics across, say, platforms. Using `@EACH` will return statistics for each, say, platform. You can also ask for a single or a subset of values, like for example `platforms=Android,Web`. This API returns data with 3 different level of detail: * Global statistics, when `campaignIds=@ALL` which is the default. * Statistics for each campaign, when `campaignIds=@EACH` or when filtering against more than one campaign at a time. * Detailed statistics by notification for a single campaign, when using `campaignIds=aSingleCampaignId`. `@EACH` can only be combined with `@ALL`, when you want to combine statistics, say, across all platforms, as well as to have the detail platform by platform. By default, the API defaults to `@ALL,@EACH`. Only event `types` cannot be combined using `@ALL` as if would make little sense to add app opens to notifications sent. The default output format groups counters into per-date objects as shown below: [block:code] { "codes": [ { "code": "{\n \"data\": [\n {\n \"date\": 1479168000000,\n \"dateISO8601\": \"2016-11-15T00:00:00.000+00:00\",\n \"campaignId\": \"@ALL\",\n \"campaignName\": \"@ALL\",\n \"counters\": [\n {\n \"type\": \"@NOTIFICATION_SENT\",\n \"count\": 79\n },\n {\n \"type\": \"@NOTIFICATION_SENT\",\n \"platform\": \"Android\",\n \"count\": 42\n },\n {\n \"type\": \"@NOTIFICATION_SENT\",\n \"platform\": \"iOS\",\n \"count\": 37\n },\n …\n ]\n },\n …\n ]\n}", "language": "json", "name": "No flattening" } ] } [/block] You can also ask to merge the counters and date objects to yield what could be called *data points*: [block:code] { "codes": [ { "code": "{\n \"data\": [\n {\n \"date\": 1479168000000,\n \"dateISO8601\": \"2016-11-15T00:00:00.000+00:00\",\n \"campaignId\": \"@ALL\",\n \"campaignName\": \"@ALL\",\n \"type\": \"@NOTIFICATION_SENT\",\n \"count\": 79\n },\n {\n \"date\": 1479168000000,\n \"dateISO8601\": \"2016-11-15T00:00:00.000+00:00\",\n \"campaignId\": \"@ALL\",\n \"campaignName\": \"@ALL\",\n \"type\": \"@NOTIFICATION_SENT\",\n \"platform\": \"Android\",\n \"count\": 42\n },\n {\n \"date\": 1479168000000,\n \"dateISO8601\": \"2016-11-15T00:00:00.000+00:00\",\n \"campaignId\": \"@ALL\",\n \"campaignName\": \"@ALL\",\n \"type\": \"@NOTIFICATION_SENT\",\n \"platform\": \"iOS\",\n \"count\": 37\n },\n …\n ]\n}", "language": "json", "name": "flatten=counters" } ] } [/block] Note that you will have as many objects sharing the same date as we had counters within the per-date object previously. Let's say you are only interested in `@NOTIFICATION_SENT` events and want a single object per date, with a platform break-down. This is easily done by using both `types=@NOTIFICATION_SENT` and `flatten=platforms`: [block:code] { "codes": [ { "code": "{\n \"data\": [\n {\n \"date\": 1479168000000,\n \"dateISO8601\": \"2016-11-15T00:00:00.000+00:00\",\n \"campaignId\": \"@ALL\",\n \"campaignName\": \"@ALL\",\n \"type\": \"@NOTIFICATION_SENT\",\n \"@ALL\": 79,\n \"Android\": 42,\n \"iOS\": 37\n },\n {\n \"date\": 1479254400000,\n \"dateISO8601\": \"2016-11-16T00:00:00.000+00:00\",\n \"campaignId\": \"@ALL\",\n \"campaignName\": \"@ALL\",\n \"type\": \"@NOTIFICATION_SENT\",\n \"@ALL\": 61,\n \"Android\": 34,\n \"iOS\": 27\n },\n …\n ]\n}", "language": "json", "name": "types=@NOTIFICATION_SENT&flatten=platforms" } ] } [/block] Note how the `count` field disappeared and the different values of `platform` have been changed into fields. If you had not controlled the types to return, you would have gotten one object per date and per type, like we had in the previous example with the platforms. In order to avoid name clashes (especially with custom event names) and to help better identify the counter fields, you can use a prefix. Here is how the previous example would look by using `flattenPrefix=platform:`: [block:code] { "codes": [ { "code": "{\n \"data\": [\n {\n \"date\": 1479168000000,\n \"dateISO8601\": \"2016-11-15T00:00:00.000+00:00\",\n \"campaignId\": \"@ALL\",\n \"campaignName\": \"@ALL\",\n \"type\": \"@NOTIFICATION_SENT\",\n \"platform:@ALL\": 79,\n \"platform:Android\": 42,\n \"platform:iOS\": 37\n },\n {\n \"date\": 1479254400000,\n \"dateISO8601\": \"2016-11-16T00:00:00.000+00:00\",\n \"campaignId\": \"@ALL\",\n \"campaignName\": \"@ALL\",\n \"type\": \"@NOTIFICATION_SENT\",\n \"platform:@ALL\": 61,\n \"platform:Android\": 34,\n \"platform:iOS\": 27\n },\n …\n ]\n}", "language": "json", "name": "types=@NOTIFICATION_SENT&flatten=platforms&flattenPrefix=platform:" } ] } [/block] You can also opt for a sub-object if you prefer by ending the prefix with a dot. Here is an example using `flattenPrefix=values.`: [block:code] { "codes": [ { "code": "{\n \"data\": [\n {\n \"date\": 1479168000000,\n \"dateISO8601\": \"2016-11-15T00:00:00.000+00:00\",\n \"campaignId\": \"@ALL\",\n \"campaignName\": \"@ALL\",\n \"type\": \"@NOTIFICATION_SENT\",\n \"values\": {\n \"@ALL\": 79,\n \"Android\": 42,\n \"iOS\": 37\n }\n },\n {\n \"date\": 1479254400000,\n \"dateISO8601\": \"2016-11-16T00:00:00.000+00:00\",\n \"campaignId\": \"@ALL\",\n \"campaignName\": \"@ALL\",\n \"type\": \"@NOTIFICATION_SENT\",\n \"values\": {\n \"@ALL\": 61,\n \"Android\": 34,\n \"iOS\": 27\n }\n },\n …\n ]\n}", "language": "json", "name": "types=@NOTIFICATION_SENT&flatten=platforms&flattenPrefix=values." } ] } [/block] Note, we do not end-up with the default format here, there is no *array* of counters, but an object containing the flatten field's values as sub-fields and associated counts as values. The `addZero` parameter will help you obtain a dense output. When a counter is 0, it is normally not even materialized into existence. The same is true if for a given date we have no counter. If using `addZero=true` we ensure that missing dates and counters are populated with 0s. This leads us to the CSV format, controlled by using `format=csv`. CSV is a table-like format, it has a set of columns presented in the first row, and a list of rows that all have the same columns. When using the CSV format, you basically impose flattening (using `flatten=counters` by default) and `addZero=true`. The keys that would be present in the data-point objects in JSON are all collected and form the set of columns, presented in the first header line. Following are each data-point object. Note that if you did not sufficiently filtered the output (using `platforms=@ALL` for instance like before) you might have several lines for a given date. Here is how the first example would look in CSV: [block:code] { "codes": [ { "code": "\"date\",\"dateISO8601\",\"campaignId\",\"campaignName\",\"type\",\"platform\",\"count\"\n1479168000000,\"2016-11-15T00:00:00.000+00:00\",\"@ALL\",\"@ALL\",\"@NOTIFICATION_SENT\",\"@ALL\",79\n1479168000000,\"2016-11-15T00:00:00.000+00:00\",\"@ALL\",\"@ALL\",\"@NOTIFICATION_SENT\",\"Android\",42\n1479168000000,\"2016-11-15T00:00:00.000+00:00\",\"@ALL\",\"@ALL\",\"@NOTIFICATION_SENT\",\"iOS\",37\n…", "language": "text", "name": "format=csv" } ] } [/block] And here is how it would look in CSV by with `types=@NOTIFICATION_SENT` and `flatten=platforms` like a later example: [block:code] { "codes": [ { "code": "\"date\",\"dateISO8601\",\"campaignId\",\"campaignName\",\"type\",\"@ALL\",\"Android\",\"iOS\"\n1479168000000,\"2016-11-15T00:00:00.000+00:00\",\"@ALL\",\"@ALL\",\"@NOTIFICATION_SENT\",79,42,37\n1479254400000,\"2016-11-16T00:00:00.000+00:00\",\"@ALL\",\"@ALL\",\"@NOTIFICATION_SENT\",61,34,27\n…", "language": "text", "name": "format=csv&types=@NOTIFICATION_SENT&flatten=platforms" } ] } [/block]