Contact devices

Unlike SMS or email, where the recipient can be an ad hoc phone number or email address, a push notification in Whispir can only be sent to registered contacts. Entering the push-token in a message’s To field is not allowed. The reason for this is primarily the way push works. A push/device token alone is not sufficient for the push to succeed; it needs the API keys (in GCM) and certificates (in APNS) of your app too. Assuming that information in every API call is costly and important, Whispir has consciously built the product to reduce the friction from such calls and into a simple pre-registered apps and contact-devices method.

To send a push notification to a contact’s device, you have to register the push token as a device under that contact. The device is a combination of device token, app platform information (APN, GCM …), and other metadata that helps Whispir to manage and do push properly.

A device is a sub-resource to a contact, and a contact can have a minimum of 0 to a maximum of 3 devices by default. However, the 3-device limit can be raised to 10 depending on your app profile needs. The limit is set during the app registration process. For more information see Registering an app.

  • JSON
  • XML

API endpoint

Generic

https://api.<region>.whispir.com/contacts/{:contact-id}/devices?apikey=<your_api_key>
Content-Type: application/vnd.whispir.contactdevice-v1+json

 

Limited to a workspace

https://api.<region>.whispir.com/workspaces/{:workspace-id}/contacts/{:contact-id}/devices?apikey=<your_api_key>
Content-Type: application/vnd.whispir.contactdevice-v1+json

 

Resource type

application/vnd.whispir.contactdevice-v1+xml
application/vnd.whispir.contactdevice-v1+json

 

Methods supported

GET
POST
PUT
DELETE