User centric API
registerUser
Section titled âregisterUserâPOST
https://api.pushwoosh.com/json/1.3/registerUser
Associates external User ID with a specified device.
Request headers
Section titled âRequest headersâName | Required | Value | Description |
---|---|---|---|
Authorization | Yes | Token XXXX | API Device Token to access Device API. Replace XXXX with your actual Device API token. |
Request body
Section titled âRequest bodyâName | Type | Description |
---|---|---|
userId | string | User ID to associate with a device. If empty, use hwid. |
application* | string | Pushwoosh application code. |
hwid* | string | Pushwoosh HWID |
tz_offset | integer | Timezone offset in seconds for the device. |
device_type | integer | Device type. See possible values in /registerDevice. |
{ "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.
{ "request": { "userId": "user_3078a", // optional. If empty, use hwid "application": "XXXXX-XXXXX", // required. Pushwoosh application code "hwid": "8f65b16df378e7a6bece9614e1530fb2", // required. Hardware device ID "tz_offset": -3600, // optional. Timezone offset in seconds "device_type": 3 // optional. Device type, see /registerDevice // for device types }}
postEvent
Section titled âpostEventâPOST
https://api.pushwoosh.com/json/1.3/postEvent
Calls the event
Request Body
Section titled âRequest BodyâName | Type | Description |
---|---|---|
hwid* | string | Hardware device ID used in a /registerDevice request. Can be used along with âuserIdâ to identify a user who has triggered an event. |
application* | string | Pushwoosh application code. |
event* | string | Event name exactly as created in Pushwoosh Control Panel. |
attributes* | object | JSON object with the event attributes. Leave it empty if no attributes need to be passed. |
timestampUTC | integer | Timestamp in UTC. |
timestampCurrent | integer | Timestamp in local time. |
userId* | string | User ID associated with a user who has triggered the event. Can be replaced by or used along with an HWID. |
device_type | integer | See possible values in /registerDevice method. |
{ "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.
{ "request":{ "hwid": "8f65b16df378e7a6bece9614e1530fb2", // required. Hardware device ID used in a /registerDevice API. // Can be used along with an userId to identify a // user who has triggered an event. "application": "XXXXX-XXXXX", // required. Pushwoosh application code "event": "activityCompleted", // required. Event name exactly as created in Pushwoosh Control Panel "attributes": { // required. Leave empty if no attributes need to be passed. "login": "facebook", "success": "yes", "internet": "wifi", }, "timestampUTC": 1435228403, // optional. Timestamp in UTC "timestampCurrent": 1435253603, // optional. Timestamp in local time // users on multiple devices. Can be replaced by // or used along with an HWID. "device_type": 1 // optional. }}