Events

API methods to manage Events

post
/createEvent

https://cp.pushwoosh.com/json/1.3/createEvent
Creates an Event for the app.
Request
Response
Body Parameters
auth
required
string
API access token from Pushwoosh Control Panel.
application
required
string
Pushwoosh application code.
name
required
string
Event name, 32 characters max.
description
optional
string
Event description, 64 characters max.
eventAttributes
optional
array
Event attributes array.
trackRevenue
optional
boolean
See Track Event Revenue section of https://www.pushwoosh.com/docs/events.
200: OK
{
"status_code": 200,
"status_message": "OK",
"response": {
"event": 351 // Created Event Id
}
}
{
"request": {
"auth":"yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
"application": "XXXXX-XXXXX", // Pushwoosh application code
"name": "BasketOpen", // 32 characters max. Event name.
"description": "Open basket page", // 64 characters max. Event description.
"eventAttributes": [ // Event attributes array
{
"type": 3, // Attribute type. Values: 1 - integer, 2 - string, 3 - list, 4 - date. 5 - boolean, 6 - price, 7 - version.
"name": "products" // 64 characters max. Attribute name
},
{
"type": 5,
"name": "delivery"
}
],
"trackRevenue": false // @see Track Event Revenue on https://www.pushwoosh.com/docs/events
}
}

Response:

200

200

Event successfully created

200

210

Argument error. See status_message for more info

200

403

Permissions error (for example, when Events limit is exceeded)

200

404

Resource not found

400

N/A

Malformed request string

500

500

Internal error

post
/getEventStatistics

https://cp.pushwoosh.com/json/1.3/getEventStatistics
Retrieves the number of times the Event was triggered during the specified period.
Request
Response
Body Parameters
auth
required
string
API access token from Pushwoosh Control Panel
application
required
string
Pushwoosh application code
event
required
string
Event name exactly as created in Pushwoosh Control Panel
date_from
required
string
Start of the period to get stats for
date_to
required
string
End of the period to get stats for
attributes
optional
array
An array of the Event attributes
200: OK
{
"status_code": 200,
"status_message": "OK",
"response": {
"request_id": "DC1_bc63f00c736696d75cea17aa6855ba19"
}
}

For Private Offering subscriptions only.

{
"request" : {
"auth":"yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
"application": "XXXXX-XXXXX", // Pushwoosh application code
"event" : "Event name", // the name of Event exactly as created in Pushwoosh Control Panel
"date_from" : "2018-09-12",
"date_to" : "2018-09-12",
"attributes" : [ // optional
{
"name": "attributeName",
"operator" : "EQ",
"values": ["val"]
}
]
}
}

Like every scheduled request, /getEventStatistics request requires an additional /getResults request

Response body:

Field

Type

Description

request_id

string

Scheduled request Id. Please check/getResults method for more information

Scheduled (/getResults) response:

Example
{
"status_code": 200,
"status_message": "OK",
"response": [
{
"date": "2018-09-12 00:00",
"count": 12
},
{
"date": "2018-09-12 01:00",
"count": 2
},
{
"date": "2018-09-12 02:00",
"count": 4
},
{
"date": "2018-09-12 03:00",
"count": 8
},
{
"date": "2018-09-12 04:00",
"count": 9
},
{
"date": "2018-09-12 05:00",
"count": 2
},
{
"date": "2018-09-12 06:00",
"count": 0
},
{
"date": "2018-09-12 07:00",
"count": 0
},
{
"date": "2018-09-12 08:00",
"count": 0
},
{
"date": "2018-09-12 09:00",
"count": 0
},
{
"date": "2018-09-12 10:00",
"count": 0
},
{
"date": "2018-09-12 11:00",
"count": 0
},
{
"date": "2018-09-12 12:00",
"count": 0
},
{
"date": "2018-09-12 13:00",
"count": 0
},
{
"date": "2018-09-12 14:00",
"count": 0
},
{
"date": "2018-09-12 15:00",
"count": 0
},
{
"date": "2018-09-12 16:00",
"count": 0
},
{
"date": "2018-09-12 17:00",
"count": 0
},
{
"date": "2018-09-12 18:00",
"count": 0
},
{
"date": "2018-09-12 19:00",
"count": 0
},
{
"date": "2018-09-12 20:00",
"count": 0
},
{
"date": "2018-09-12 21:00",
"count": 0
},
{
"date": "2018-09-12 22:00",
"count": 0
},
{
"date": "2018-09-12 23:00",
"count": 0
}
]
}