View All Triggered Campaigns
This API endpoint returns a paginated list of all Triggered campaigns. The campaigns are listed in descending order, with the most recently created campaigns appearing first.
GET
https://api.pushengage.com/apiv1/triggers
Query Parameters
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| analytics_start_at | String | No | The UTC start date for the analytics data in the YYYY-MM-DD (ISO 8601) format. |
| analytics_end_at | String | No | The UTC end date for the analytics data in the the YYYY-MM-DD (ISO 8601) format. |
| page | Number | No | Default: 1, >=1The page number for the requested data. The value should be greater than 1. |
| limit | Number | No | Default: 10, [1..500]The number of items per page. The value should be between 1 to 500. |
Response Object
The response object returned by the API endpoint contains the details about Triggered campaigns. The response also includes metadata such as total number of results, current page, last page and results per page.
| Property Name | Type | Required | Description |
|---|---|---|---|
| success | Boolean | Yes | Indicates whether the API call was successful or not. |
| data | Triggered Campaign[] | Yes | An Array of Triggered campaign object. |
| meta | Object | Yes | An object containing metadata for the response. |
| meta.total | Number | Yes | The total number of results. |
| meta.page | Number | Yes | The current page number. |
| meta.perPage | Number | Yes | The number of results per page. |
| meta.lastPage | Number | Yes | The last page number. |
Triggered Campaign
| Property Name | Type | Required | Description |
|---|---|---|---|
| trigger_id | Number | Yes | The unique identifier for the campaign. |
| campaign_name | String | Yes | The name of the campaign. |
| campaign_type | String | Yes | Valid values: generic, browse, trigger, price_drop, inventoryType of the Triggered campaign. |
| status | String | Yes | Valid values: draft, active, pause, deletedThe status of the Triggered campaign. |
| site_id | Number | Yes | The unique identifier of the site associated with the campaign. |
| created_at_utc | String | Yes | The UTC timestamp when the campaign was created in ISO 8601 format. |
| updated_at_utc | String | Yes | The UTC timestamp when the campaign was last updated in ISO 8601 format. |
| daily_trigger_limit | Number | Yes | This specifies the maximum number of notifications that can be sent to a user in a day. |
| weekly_trigger_limit | Number | Yes | This specifies the maximum number of notifications that can be sent to a subscriber in a week, which includes the last seven days. |
| rules | Object | Yes | The object includes the settings for the start and stop event names of the Triggered campaign. |
| rules.start_event_name | String | Yes | This is the name of the event that triggers the start of the campaign when it is fired by a user. |
| rules.stop_event_name | String | Yes | This is the name of the event that triggers the stop of the campaign when it is fired by a user. |
| analytics | Analytics | Yes | An object containing analytics information for the Triggered campaign. |
| options | Options | No | An object that contains extra options for a triggered campaign. |
| utm_params | UTM Params | No | An object containing UTM parameters for the Triggered campaign. |
Analytics Object
| Property Name | Type | Required | Description |
|---|---|---|---|
| views | Number | Yes | The number of view for the notification. |
| clicks | Number | Yes | The number of clicks on the notification. |
| sentcount | Number | Yes | The number of notification sent. |
| unsubscribed | Number | Yes | The number of unsubscribes for the notification. |
| ctr | Number | Yes | The click-through rate for the the notification. |
| result | Array | No | An array of analytics result/goal object associated with the notification. |
| result.*.name | String | No | The name of the goal. |
| result.*.count | Number | No | The count of the goal. |
| result.*.value | Number | No | The value of the goal. |
Options Object
| Property Name | Type | Required | Description |
|---|---|---|---|
| result_name | String | No | A string that specifies the name of the goal that the campaign will track. |
| campaign | Object | No | An object that contains options related to the campaign settings. |
| campaign.expiry | String | No | Default: 2592000 (30 days)A number that specifies the time duration in seconds until the campaign expires. Applicable only when campaign type is price_drop or inventory |
| campaign.price_drop_threshold | Object | No | An object that contains options related to the price drop threshold. Required only when campaign type is set to price_drop. |
| campaign.price_drop_threshold.type | String | No | Valid values: absolute, percentageA string that specifies the type of threshold. |
| campaign.price_drop_threshold.value | Object | No | A number that specifies the value of the threshold. |
UTM params Object
| Property Name | Type | Required | Description |
|---|---|---|---|
| utm_source | String | Yes | The UTM source parameter value included in the URL of the notifications for the campaign. |
| utm_medium | String | Yes | The UTM medium parameter value included in the URL of the notifications for the campaign. |
| utm_campaign | String | Yes | The UTM campaign parameter value included in the URL of the notifications for the campaign. |
| utm_term | String | No | The UTM term parameter value included in the URL of the notifications for the campaign. |
| utm_content | String | No | The UTM content parameter value included in the URL of the notifications for the campaign. |
Example
Request
- cURL
- PHP
curl --location --request GET 'https://api.pushengage.com/apiv1/triggers?analytics_start_at=2023-02-30&analytics_end_at=2023-03-30&page=1&limit=10' \
--header 'Api-Key: <YOUR_API_KEY>'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.pushengage.com/apiv1/triggers?analytics_start_at=2023-02-30&analytics_end_at=2023-03-30&page=1&limit=10',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Api-Key: <YOUR_API_KEY>'
),
));
$response = curl_exec($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
Response
- 200 OK
- 401 Unauthorized
- 400 Bad Request
- 500 Internal Server Error
{
"success": true,
"data": [
{
"trigger_id": 30987606,
"campaign_name": "Triggered Campaign",
"campaign_type": "generic",
"utm_params": {
"utm_source": "PushEngage",
"utm_medium": "Push Notification",
"utm_campaign": "Triggered Campaign",
"utm_term": "UTM Term",
"utm_content": "UTM Content"
},
"status": "active",
"site_id": 3288973,
"created_at_utc": "2023-02-27T06:53:27Z",
"updated_at_utc": "2023-02-27T06:53:27Z",
"daily_trigger_limit": 1,
"weekly_trigger_limit": 7,
"options": {
"result_name": "revenue"
},
"analytics": {
"ctr": 10,
"views": 100,
"clicks": 10,
"sentcount": 150,
"unsubscribed": 10,
"result": [
{
"name": "revenue",
"count": 10,
"value": 300
}
]
},
"rules": {
"start_event_name": "start",
"stop_event_name": "end"
}
}
],
"meta": {
"total": 1,
"page": 1,
"lastPage": 1,
"perPage": 10
}
}
{
"success": false,
"message": "API KEY Invalid"
}
{
"success": false,
"error": {
"name": "InvalidRequestException",
"message": "Error Message"
}
}
{
"success": false,
"message": "Error message"
}