Api

Api call URL Method Description
Notify /publicapi/notify POST Sends a notification to your device(s)
Verify /publicapi/verify GET Verifies an API key
Although all calls accept both HTTP and HTTPS, it's highly recommended to use HTTPS for all calls.

Notify

/publicapi/notify

This is what you use to send a notification. You can include an unlimited number of API Keys in your call.

You can also send pushmessages to your device from any email account. Check out the Api keys page for more information!
Parameter Length (bytes) Description
apikey* unlimited A single apikey or a commaseparated list of apikeys. Each apikey must be a 48 bytes hex string.
application* 256 (max) The name of the application the notification originates from.
event* 1000 (max) The event that occured. Depending on your application, this might be a summary, subject or a brief explanation.
description* 10 000 (max) The full body of the notification.
priority - An optional value representing the priority of the notification.
type xml/json Specifies the responsetype you want. You can currently choose between JSON or XML (default)
* Required

Return codes

Code Description
200 Notification submitted.
400 The data supplied is in the wrong format, invalid length or null.
401 None of the API keys provided were valid.
402 Maximum number of API calls for a given period is exeeded
500 Internal server error. Please contact our support if the problem persists.
All data submitted should be UTF-8 encoded.

Verify

/publicapi/verify

This call verifies an API key and should always be used when you receive an API key from a user for the first time.

Parameter Length (bytes) Description
apikey* 48 A single apikey.
* Required

Return codes

Code Description
200 The API key is valid
400 The data supplied is in the wrong format, invalid length or null.
401 The API key is invalid
402 Maximum number of API calls for a given period is exeeded
500 Internal server error. Please contact our support if the problem persists.

Response messages

Success message

If everything is fine and dandy, you'll get a responsemessage that contains a code=200. If any supplemental information is required, this is wrapped in the <success> tag.

Examples
<nmwp>
  <success Code="200">The key is valid</success>
</nmwp> 
<nmwp>
  <success Code="200" />
</nmwp> 

Error message

When an error occures, the response contains an <error> tag. This element contains the code of the error, and also a more descriptive errormessage.

Examples
<nmwp>
  <error Code="401">The key is invalid</error>
</nmwp> 
<nmwp>
  <error Code="400">Event is required</error>
</nmwp> 
Always use a XML Parser. Changes might break custom xml parsers or string parsers