Campaigns

API methods to manage Campaigns

post
/createCampaign

https://cp.pushwoosh.com/json/1.3/createCampaign
Creates a push campaign within 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
Campaign name.
description
optional
string
Campaign description.
200: OK
{
"status_code": 200,
"status_message": "OK",
"response": {
"campaign": "XXXXX-XXXXX"
}
}

For Private Offering subscriptions only.

{
"request": {
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
"application": "XXXXX-XXXXX", // Pushwoosh application code
"name": "CAMPAIGN_NAME",
"description": "CAMPAIGN_DESCRIPTION"
}
}

post
/deleteCampaign

https://cp.pushwoosh.com/json/1.3/deleteCampaign
Deletes a particular campaign.
Request
Response
Body Parameters
auth
required
string
API access token from Pushwoosh Control Panel.
campaign
required
string
ID of a campaign to delete.
200: OK
{
"status_code": 200,
"status_message": "OK",
"response": null
}

For Private Offering subscriptions only.

Example
{
"request": {
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
"campaign": "XXXXX-XXXXX" // ID of a campaign to delete
}
}

post
/getCampaignStats

https://cp.pushwoosh.com/json/1.3/getCampaignStats
Displays statistics of a particular campaign.
Request
Response
Body Parameters
auth
required
string
API access token from Pushwoosh Control Panel.
campaign
required
string
Campaign ID.
datefrom
required
string
Date and time, start of the reporting period. Formatted date: Y-m-d H:i:s
dateto
required
string
Date and time, end of the reporting period. Formatted date: Y-m-d H:i:s
200: OK
{
"status_code": 200,
"status_message": "OK",
"response": {
"request_id": "a3ef436445abfdef6255cc2f65ce7614"
}
}

For Private Offering subscriptions only.

{
"request": {
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
"campaign": "XXXXX-XXXXX", // campaign ID
"datefrom": "Y-m-d H:i:s", // date and time, start of the reporting period
"dateto": "Y-m-d H:i:s" // date and time, end of the reporting period
}
}

As every scheduled request, /getCampaignStats request requires an additional /getResults request.

/getResults response:

Example
{
"status_code": 200,
"status_message": "OK",
"response": {
"formatter": "hourly",
"rows": [
{
"count": 0,
"action": "open",
"datetime": "2018-05-09 00:00:00",
"platformid": 14
},
{
"count": 0,
"action": "send",
"datetime": "2018-05-09 00:00:00",
"platformid": 14
},
{
"count": 0,
"action": "send",
"datetime": "2018-05-11 00:00:00",
"platformid": 14
}
],
// conversion (if goal tracking is allowed)
"conversion": {
"send": 10,
"open": 5,
"events": [
{"uid": 1, "event": "event name", "hits": 5, "conversion": "100%",
"revenue": 15.34}
]
}
}
}

post
/getCampaigns

https://cp.pushwoosh.com/json/1.3/getCampaigns
Retrieves the list of campaigns for the app.
Request
Response
Body Parameters
auth
required
string
API access token from Pushwoosh Control Panel.
application
required
string
Pushwoosh application code.
cursor
optional
string
Indicates the last campaign retrieved in the previous request.
limit
optional
integer
The max number of campaigns for a single response.
200: OK
{
"status_code": 200,
"status_message": "OK",
"response": {
"campaigns": [
{
"code": "7CFF3-63A7B",
"name": "CAMPAIGN_NAME_1",
"description": "DESCRIPTION1"
},
{
"code": "C284C-33DD3",
"name": "CAMPAIGN_NAME_2",
"description": "DESCRIPTION2"
}
],
"limit": 100,
"cursor": "+4PxJPhhwITD4PFsiKui1BA=="
}
}
Example
{
"request": {
"auth": "jLcRP74KodNa2UW........ztFSOJAQNAB9f5Za", // API access token from Pushwoosh Control Panel
"application": "XXXXX-XXXXX", // Pushwoosh application code
"cursor": "+4PxJPhhwITD4PFsiKui1BA==", // Indicates the last campaign retrieved in the previous request.
"limit": 100 // The max number of campaigns for a single response.
}
}