Sections ▾

POST ​/api​/push_notifications​/gcm

Sends GCM push notifications to Android device[s].

  
  curl -X POST "https://app.contexthub.com/api/push_notifications/gcm" \
       -H "Authorization: Token token=\"534e565f-335a-469d-974e-e18a85f00d2d\"" \
       -H "CONTEXTHUB_DEVICE_ID: DB4E6157-D64F-43EE-B114-39A13D2B9BC7" \
       -H "Content-Type: application/json" \
       -d $'{ "tags":["phones"],\n"data": {"alert":"Hello world",\n"badge": 42\n}\n}' \
       -m 30 \
       -v \
  

Request

Example Request

{
  "registration_ids": [
    "A09DF2B42252E414DB53593CC050DFCF8451B9AAF80ACB8CE3605CDC7014D22C_A09DF2B42252E414DB53593CC050DFCF8451B9AAF80ACB8CE3605CDC7014D22C"
  ],
  "alias": "android",
  "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"
  ],
  "expiry": 0,
  "collapse_key": "new content",
  "data": {
  }
}

Example Parameters

Response

Example Response

{
}

Response Parameters

Response Codes

Successful Response Codes

Failure Response Codes