Sections ▾

POST ​/api​/push_notifications​/apns

Sends APNS push notifications to IOS device[s]. By default, APNS messages will be sent to Apple’s production gateway server. If you want to send messages to the sandbox gateway server, be sure to include the CARBON_DEBUG header in your request.

Example:

  
CARBON_DEBUG: On
  
  
  curl -X POST "https://app.contexthub.com/api/push_notifications/apns" \
       -H "Authorization: Token token=\"534e565f-335a-469d-974e-e18a85f00d2d\"" \
       -H "CONTEXTHUB_DEVICE_ID: DB4E6157-D64F-43EE-B114-39A13D2B9BC7" \
       -H "Content-Type: application/json" \
       -d $'{ "device_ids":["0C07F53C-5C14-441B-A977-C6AF473770F8", "A065427D-B111-45D7-A004-546044E6966E", "666B1F70-FD24-43BB-9258-EC7CC75908D6"],\n"alert":"Hello world",\n"badge": 42\n}' \
       -m 30 \
       -v \
  

Request

Example Request

{
  "push_tokens": [
    "A09DF2B42252E414DB53593CC050DFCF8451B9AAF80ACB8CE3605CDC7014D22C"
  ],
  "alias": "iphone",
  "tags": "employee",
  "tag_operator": "ALL",
  "device_ids": [
    "B3B9CEE2-EE80-4815-957A-40CDB4D1BF8C"
  ],
  "exclude_device_ids": [
    "B3B9CEE2-EE80-4815-957A-40CDB4D1BF8C"
  ],
  "exclude_push_tokens": [
    "B3B9CEE2-EE80-4815-957A-40CDB4D1BF8C"
  ],
  "mdm": "magic",
  "priority": 10,
  "expiry": 0,
  "category": "INVITE_CATEGORY",
  "url_args": "",
  "badge": 42,
  "sound": "default",
  "alert": "Hello World",
  "content_available": 1,
  "data": {
  }
}

Example Parameters

Response

Example Response

{
}

Response Parameters

Response Codes

Successful Response Codes

Failure Response Codes