LATEST VERSION: 1.9 - CHANGELOG
Push Notification Services v1.9

Schedule

This document decscibes the endpoints for managing scheduled pushes.

Pushes can be scheduled for delivery in the future by providing the schedule information in the /v1/push POST API. These pushes return a schedule_id field that can be used as the identify for the /v1/schedule APIs that are descibed below.

GET /v1/schedules

Get all scheduled pushes for an application.

Authentication: HTTP Basic app_uuid:api_key

Query Parameters: None

Request Body:

None.

Response Data, status: 200 (OK)

[
  {
    "schedule_id": "fc226fbc1443ebfe",
    "scheduled_for": 1423513994000,    # Epoch Timestamp in milliseconds
    "push": {
      "scheduleAt": 1423513994000,     # Epoch Timestamp in milliseconds
      "scheduleIn": 0,
      "expiryTime": null,
      "message": {
        "custom": {
          "ios": {
            "alert": {
                  "body": "",          # The body of the push message (overrides body defined above)
                  "action-loc-key": "",
                  "loc-key": "",
                  "loc-args": [ "arg1", "arg2", ... ],
                  "title": "",
                  "title-loc-key": "",
                  "title-loc-args": [ "arg1", "arg2", ... ],
                  "launch-image": ""
            },
            "category": "",
            "badge": 0,
            "sound": "",
            "content-available": false,
            "extra": {}
          },
          "android": "object"
        },
        "body": ""
      },
      "target": {
        "topics": [ "topic1", "topics2", ... ],
        "platforms": [ "platform1", "platform2", ... ],
        "devices": [ "device_uuid1", "device_uuid2", ... ],
        "interactive-only": false
      }
    }
  }
]

GET /v1/schedules/:schedule_id

Get a single scheduled push for an application.

Authentication: HTTP Basic app_uuid:api_key

Query Parameters: None

Request Body:

None.

Response Data, status: 200 (OK)

{
  "schedule_id": "fc226fbc1443ebfe",
  "scheduled_for": 1423513994000,                    # Epoch Timestamp in milliseconds
  "push": {
    "scheduleAt": 1423513994000,                     # Epoch Timestamp in milliseconds
    "scheduleIn": 0,
    "expiryTime": null,
    "message": {
      "custom": {
        "ios": {
          "extra": "object",
          "category": "",
          "badge": 0,
          "sound": "",
          "content-available": false,
          "alert": {
            "body": "",
            "loc-key": "",
            "action-loc-key": "",
            "loc-args": [ "arg1", "arg2", ... ],
            "launch-image": ""
          }
        },
        "android": "object"
      },
      "body": ""
    },
    "target": {
      "interactive-only": false,
      "platform": "",
      "topics": [ "topic1", "topic2", ... ],
      "platforms": [ "platform1", "platform2", ... ],
      "devices": [ "device_uuid1", "device_uuid2", ... ]
    }
  }
}

PUT /v1/schedules/:schedule_id

Update a scheduled push for an application.

Authentication: HTTP Basic app_uuid:api_key

Query Parameters: None

Request Body:

{
  "scheduleAt": 1345852800000,     # Epoch timestamp in milliseconds.
  "message": {
    "custom": {
      "android": "object"
    },
    "body": ""
  },
  "target": {
    "interactive-only": false,
    "platform": "",
    "platforms": [ "platform1", "platform2", ... ],
    "topics": [ "topic1", "topic2", ... ],
    "devices": [ "device_uuid1", "device_uuid2", ... ]
  }
}

Response Data, status: 200 (OK)

{
  "schedule_id": "fc226fbc1443ebfe",
  "scheduled_for": 1345852800000,    # Epoch Timestamp in milliseconds
  "push": {
    "scheduleAt": 1345852800000,
    "scheduleIn": 0,
    "expiryTime": null,
    "message": {
      "custom": {
        "ios": {
          "extra": "object",
          "category": "",
          "badge": 0,
          "sound": "",
          "content-available": false,
          "alert": {
            "body": "",
            "loc-key": "",
            "action-loc-key": "",
            "loc-args": [ "arg1", "arg2", ... ],
            "launch-image": ""
          }
        },
        "android": "object"
      },
      "body": ""
    },
    "target": {
      "interactive-only": false,
      "platform": "",
      "platforms": [ "platform1", "platform2", ... ],
      "topics": [ "topic1", "topic2", ... ],
      "devices": [ "device_uuid1", "device_uuid2", ... ]
    }
  }
}

DELETE /v1/schedules/:schedule_id

Cancel a scheduled push for an application.

Authentication: HTTP Basic app_uuid:api_key

Query Parameters: None

Request Body:

None.

Response Data, status: 204 (NO CONTENT)

Create a pull request or raise an issue on the source for this page in GitHub