User Centric API

API methods to manage users

post
/registerUser

https://cp.pushwoosh.com/json/1.3/registerUser
Associates external User ID with a specified device.
Request
Response
Body Parameters
userId
required
string
User ID to associate with a device. If empty, use hwid.
application
required
string
Pushwoosh application code.
hwid
required
string
Unique string to identify the device (IDFV/IDFA on iOS and "Android Advertising ID" or ANDROID_ID on Android).
tz_offset
optional
integer
Timezone offset in seconds for the device.
device_type
required
integer
Device type. See possible values in /registerDevice.
200: OK
{
"status_code": 200,
"status_message": "OK",
"response":null
}

Can be used later in /createMessage API call (the users parameter). This is normal to call this function before you have the push token and before /registerDevice call.

Example
{
"request": {
"userId": "user_3078a", // type: string. If empty, use hwid
"application": "XXXXX-XXXXX", // Pushwoosh application code
"hwid": "8f65b16df378e7a6bece9614e1530fb2", // Hardware device ID
"tz_offset": -2917, // Timezone offset
"device_type": 3 // device type, see /registerDevice for device types
}
}

For emails, call /registerEmailUser.

post
/postEvent

https://cp.pushwoosh.com/json/1.3/postEvent
Calls the event within the app.
Request
Response
Body Parameters
hwid
required
string
Hardware device ID used in /registerDevice request.
application
required
string
Pushwoosh application code.
event
required
string
Event name as created in Pushwoosh Control Panel.
attributes
optional
object
JSON object with the event attributes.
timestampUTC
optional
integer
Timestamp in UTC.
timestampCurrent
optional
integer
Timestamp in local time.
userId
required
string
User ID associated with a user who has triggered the event. If empty, send HWID.
device_type
required
integer
See possible values in /registerDevice method.
200: OK
{
"status_code": 200,
"status_message": "OK",
"response": {
"code": "61BC9-84DD0"
}
}

The event's name in the request must match the event name in Pushwoosh Control Panel. Note that "attributes" property may be empty (but not omitted) in case the event has no attributes.

Example
{
"request":{
"hwid": "8f65b16df378e7a6bece9614e1530fb2", // hardware device ID
"application": "XXXXX-XXXXX", // Pushwoosh application code
"event": "activityCompleted", // event name exactly as created in Pushwoosh Control Panel
"attributes": {
"login": "facebook",
"success": "yes",
"internet": "wifi",
...
},
"timestampUTC": 1435228403, // timestamp in UTC
"timestampCurrent": 1435253603, // timestamp in local time
"userId": "someuser@user.com", // a user id which is used for identification of users on multiple devices. If empty send HWID
"device_type": 1
}
}

post
/getUserDetails

https://cp.pushwoosh.com/json/1.3/getUsersDetails
Returns mapped devices and tag data for a specified userID.
Request
Response
Body Parameters
auth
required
string
API access token from Pushwoosh Control Panel.
application
required
string
Pushwoosh application code.
userIds
required
array
IDs of the users to get info for.
200: OK
{
"status_code": 200,
"status_message": "OK",
"response": {
"request_id": "12348b2aa4162fb478bd1fb5fcbb1254"
}
}

Enterprise API

Example
{
"request": {
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
"application": "XXXXX-XXXXX", // Pushwoosh application code
"userIds": ["user_id321"]
}
}

Like every scheduled request, /getUsersDetails requires an additional /getResults request.

Response body:

Field

Type

Description

request_id

string

Scheduled request ID. Please check /getResults method for more info.

Scheduled (/getResults) response:

Example
{
"status_code": 200,
"status_message": "OK",
"response": {
"devices": [
{
"applicationCode": "APPLICATION_CODE",
"hwid": "HWID",
"pushToken": "PUSH_TOKEN",
"type": 3,
"tzOffset": 0,
"tags": "{\"First Install\":\"2017-07-25\"}",
"badges": 0,
"androidPackages": "[]",
"latitude": null,
"longitude": null,
"publicKey": "",
"authToken": "",
"userId": "myuser_id321"
}
]
}
}