Push Notifications

Push notifications are used to notify users of events that occur in the background, such as incoming messages or calls.

After authenticating, a mobile client can register a device push notification token with the server using the Register Device endpoint. This token is then used to send push notifications to the client's device.

Push Notification Provider
ValueDescription
gcmGoogle Cloud Messaging (Android)
apnsApple Push Notification Service (iOS)
apns_internalApple Push Notification Service (iOS internal)
apns_voip 1VOIP Apple Push Notification Service (iOS)
apns_internal_voip 1VOIP Apple Push Notification Service (iOS internal)

1 VOIP-specific push notification providers are used to provide rich notifications for VOIP calls on iOS.

Endpoints

Register Device

POST/users/@me/devices

Registers a GCM/APNs push notification token for the client's device. Returns a 204 empty response on success.

JSON Params
FieldTypeDescription
providerstringThe push notification provider of the device
tokenstringThe push notification token to register
voip_provider? 1stringThe VOIP push notification provider of the device
voip_token? 1stringThe VOIP push notification token to register

1 VOIP-specific push notification tokens are only used with PushKit on iOS.

Unregister Device

DELETE/users/@me/devices

Unregisters a GCM/APNs push notification token for the client's device. Returns a 204 empty response on success.

JSON Params
FieldTypeDescription
providerstringThe push notification provider of the device
tokenstringThe push notification token to unregister

Get Device Sync Token

GET/users/@me/devices/sync-token

Returns a push notification sync token for the current user. This token can be used to synchronize push notification tokens across multiple accounts.

Response Body
FieldTypeDescription
tokenstringThe push notification sync token
Example Response
{ "token": "ODUyODkyMjk3NjYxOTA2OTkz.ZfoufA.rHvCtpfHjr9kdRab1ZTl83PRhhZ" }

Sync Devices

PUT/users/@me/devices/sync

Synchronizes the client's GCM/APNs push notification token across multiple accounts.

JSON Params
FieldTypeDescription
providerstringThe push notification provider of the device
tokenstringThe device push notification token
push_sync_tokens 1array[string]Device sync tokens for each account

1 A device sync token can be obtained for each account using the Get Device Sync Token endpoint.

Response Body
FieldTypeDescription
invalid_push_sync_tokensarray[string]Device sync tokens that are invalid
Example Response
{ "invalid_push_sync_tokens": ["ODUyODkyMjk3NjYxOTA2OTkz.ZfoufA.rHvCtpfHjr9kdRab1ZTl83PRhhZ"] }