Device API
List of methods for working with devices
Last updated
List of methods for working with devices
Last updated
POST
https://api.pushwoosh.com/json/1.3/registerDevice
Called internally from the SDK. Registers device for the application.
Name | Type | Description |
---|---|---|
Possible device types:
1 – iOS
3 – Android
7 – OS X
8 – Windows 8
9 – Amazon
10 – Safari
11 – Chrome
12 – Firefox
17 – Huawei
18 – SMS
19 – Xiaomi
To register a email subscriber for your app, send the "email": "email_address@domain.com"
param in your /registerDevice
or /registerEmail
request as follows:
Status codes:
POST
https://go.pushwoosh.com/json/1.3/unregisterDevice
Removes the device's push token. The unregistered device is still counted in Total Devices and can be reached with In-Apps. Called internally from the SDK.
For emails call /deleteEmail
.
Status codes:
POST
https://go.pushwoosh.com/json/1.3/setTags
Sets tags values for the device. Called from the SDK.
The method is called from the SDK. It is possible to call it remotely from your backend, however you need to maintain an up-to-date database of hwid’s on the backend side.
To increment a value of the Integer Tag, use the operation
parameter with the "increment" value as follows:
To decrement, use the negative numbers as the value for the "increment" operation (-1, -2, -3,-n):
To extend the List Tag with new values, use the operation
parameter with the "append" value as follows:
To remove some values from the List Tag, use the "remove" operation as follows:
To set tags for all devices associated to a particular User ID, use the "userId" parameter instead of "hwid".
Make sure the tag you're setting values for is user-specific.
For emails call /setEmailTags
.
Status codes:
POST
https://go.pushwoosh.com/json/1.3/getTags
Retrieves a list of tags with corresponding values for the specific device.
POST
https://api.pushwoosh.com/json/1.3/setBadge
Sends current badge value for a device to Pushwoosh. Called internally from the SDK.
Called from the SDK internally. Sends current badge value for a device to Pushwoosh. This happens internally when app changes badge value on iOS device. Allows auto-incrementing badges to work properly.
This method IS NOT used to update the badge value on the device. Instead please use /createMessage
request with the "ios_badges"
parameter
POST
https://api.pushwoosh.com/json/1.3/applicationOpen
Registers an app open event. Called internally from the SDK.
POST
https://api.pushwoosh.com/json/1.3/pushStat
Registers a push open event. Called internally from the SDK.
POST
https://api.pushwoosh.com/json/1.3/messageDeliveryEvent
Registers push delivery event for the device. Called internally from the SDK.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
application*
string
Pushwoosh application code.
push_token
string
Push token for the device.
language
string
Language locale of the device. Must be a lowercase two-letter code according to ISO-639-1 standard.
hwid*
string
Unique string to identify the device (IDFV on iOS, randomly generated value on Android).
timezone
integer
Timezone offset in seconds for the device.
device_type*
integer
Device type. See possible values below.
string
Email address to register (use for email users instead of HWID and push token).
tags
object
Tag values to assign to the device registered.
HTTP Status code
status_code
Description
200
200
Device successfully registered
200
210
Argument error. See status_message for more info.
400
N/A
Malformed request string
500
500
Internal error
application*
string
Pushwoosh application code.
hwid*
string
Hardware device ID used in /registerDevice request.
HTTP Status code
status_code
Description
200
200
Device successfully unsubscribed
200
210
Argument error. See status_message for more info.
400
N/A
Malformed request string
500
500
Internal error
application*
string
Pushwoosh application code.
hwid*
string
Hardware device ID used in /registerDevice request.
tags*
object
JSON object of tags to set, send "null" to remove the value.
HTTP Status code
status_code
Description
200
200
Tags have been successfully set
200
210
Argument error. See status_message for more info.
400
N/A
Malformed request string
500
500
Internal error
application*
string
Pushwoosh application code.
userId
string
User identifier to be used instead of "hwid". If used together with a "hwid", the "hwid" prevails.
hwid
string
Hardware device ID used in /registerDevice request.
application*
string
Pushwoosh application code.
hwid*
string
Hardware device ID used in /registerDevice request.
badge*
integer
Current badge on the application.
application*
string
Pushwoosh application code.
hwid*
string
Hardware device ID used in /registerDevice request.
application*
string
Pushwoosh application code.
hwid*
string
Hardware device ID used in /registerDevice request.
userId
string
The user ID to associate with the push open event.
hash
string
Hash tag received in push notification ("p" parameter of the push payload).
application*
string
Pushwoosh application code.
hwid*
string
Hardware device ID used in /registerDevice request.
hash
string
Hash tag received in push notification ("p" parameter of the push payload).