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

AttributeTypeExampleDescription
messageObject
{
    "eng": "English message"
}

An object where the properties are the languages and the values are short messages.

extra_messageObject
{
    "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.

urlString
"http://www.greencopper.com"

A URL where the notification should link to.

button_labelObject
{
    "eng": "Button text"
}
The label of the button for the link if both url and extra_message are provided.
created_datetimeDatetime string
in
ISO 8601 format
"2017-01-21T16:00:00"
The datetime of when the push was created, in UTC format.
scheduled_datetimeDatetime 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
or
Array of integers

1

or

[1, 2]
A target ID or a list of IDs
ios_gc_user_idsArray 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_idsArray 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_idsArray 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



String



"READY"

The current status of the push notification.

"READY": Waiting to be sent
"IN_PROGRESS": Currently being sent
"SUCCESS": Successfully sent
"ERROR": There was en error sending the push notification

status_android
sent_ios


Integer


18234


Number of push sent to Apple and Google servers.

sent_android
webhook_urlStringhttp://www.domain.com/callbackA 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