GET /alerts/<id>/ - Get push details
Get the details of a push notification
Endpoint: /alerts/
HTTP method: GET
Parameters:
<id>: ID of the push object
Format: JSON
Properties
Attribute | Type | Example | Description |
---|---|---|---|
message | Object | { "eng": "English message" } | An object where the properties are the languages and the values are short messages. |
extra_message | Object | { "eng": "<p>English extra content</p>" } | An object where the properties are the languages and the values are additional content to be sent with the notification. |
url | String | "http://www.greencopper.com" | A URL where the notification should link to. |
button_label | Object | { "eng": "Button text" } | The label of the button for the link if both url and extra_message are provided. |
created_datetime | Datetime string in ISO 8601 format | "2017-01-21T16:00:00" | The datetime of when the push was created, in UTC format. |
scheduled_datetime | Datetime string in ISO 8601 format | "2017-01-21T16:00:00" | The datetime of when the push is scheduled to be sent, in UTC format. |
target_ids | Integer | 1 or [1, 2] | A target ID or a list of IDs |
ios_gc_user_ids | Array of strings | [ "57573a2f-4683-4a18-a29e-2ad0f0f1f809", "4a82d315-7c1c-4386-9dd9-3778e5a13372" ] | A list of gc_user_id to target specific iOS devices. |
android_gc_user_ids | Array of strings | [ "e40fbbfa-13ab-46ef-ae6e-2619ff0ebca9" , "26d2a0a4-4f76-45cc-b85e-2c2f5ab70e48" ] | A list of gc_user_id to target specific Android devices. |
gc_user_ids | Array of strings | [ "e40fbbfa-13ab-46ef-ae6e-2619ff0ebca9" , "26d2a0a4-4f76-45cc-b85e-2c2f5ab70e48" ] | A list of gc_user_id. Can be a mix of both iOS and Android. *Will be filled only if the field was used when creating the push. |
status_ios |
|
| The current status of the push notification. "READY": Waiting to be sent |
status_android | |||
sent_ios |
|
|
|
sent_android | |||
webhook_url | String | http://www.domain.com/callback | A URL to callback when the push is processed. |
Response
The response will return the Push notification object in JSON format.
Example
Status 200: A scheduled push pending to be sent
{ "id": 32, "message": { "fre": "court message", "eng": "short message" }, "extra_message": { "fre": "<p>message supplementaire</p>" "eng": "<p>extra message</p>" }, "url": "http://google.com", "created_datetime": "2016-04-02T18:38:12", "scheduled_datetime": "2016-04-03T18:38:12", "ios_device_tokens" : [ "57573a2f-4683-4a18-a29e-2ad0f0f1f809", "4a82d315-7c1c-4386-9dd9-3778e5a13372" ], "android_device_tokens": [ "e40fbbfa-13ab-46ef-ae6e-2619ff0ebca9", "26d2a0a4-4f76-45cc-b85e-2c2f5ab70e48" ], "status_ios": "READY", "status_android": "READY", "sent_ios": null, "sent_android": null, "webhook_url": "http://www.domain.com/callback" }
Status 200: A successfully sent push
{ "id": 32, "message": { "fre": "court message", "eng": "short message" }, "extra_message": { "fre": "<p>message supplementaire</p>" "eng": "<p>extra message</p>" }, "url": "http://google.com", "created_date": "2016-04-02T18:38:12", "scheduled_date": "2016-04-03T18:38:12", "ios_device_tokens" : [ "57573a2f-4683-4a18-a29e-2ad0f0f1f809", "4a82d315-7c1c-4386-9dd9-3778e5a13372" ], "android_device_tokens": [ "e40fbbfa-13ab-46ef-ae6e-2619ff0ebca9", "26d2a0a4-4f76-45cc-b85e-2c2f5ab70e48" ], "status_ios": "SUCCESS", "status_android": "SUCCESS", "sent_ios": 2492, "sent_android": 1823, "webhook_url": "http://www.domain.com/callback" }
Status 404: A non-existing ID or the push was deleted