System Campaigns API
- Table of Contents
- Get a list of campaigns across all organizations
Get a list of campaigns across all organizations
This API provides a way for system administrators to access the list of all campaigns that have started sending, across the system.
- Campaigns that are currently sending
- Campaigns that started sending and were subsequently paused
- Campaigns that failed or were cancelled
- Campaigns that finished sending
The API user that accesses this endpoint must be a system_admin
.
URL
GET /ga/api/v2/system_campaigns
Request Parameters
This endpoint accepts pagination parameters.
page |
The page number to return (starting at |
per_page |
The number of records per page (default |
This endpoint also accepts parameters to filter based on the time that the campaign started.
started_at__start |
An ISO 8601 Date/Time string representing the earliest |
started_at__end |
An ISO 8601 Date/Time string representing the latest |
Furthermore, you can provide provide a key to exclude sending
campaigns from this report.
exclude_active_campaigns |
Only report campaigns that are Finished, Cancelled or Failed (value: |
Pagination Order
The campaigns returned are sorted in the following order:
- By the time the campaign started sending (this is usually unique)
- By the campaign ID
Response
campaign_report
array of hashes Array where each item is an organization with the following attributes.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mailing_list
hash
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
campaign
hash
|
This endpoint also returns pagination details.
page |
The current page number |
per_page |
The number of records per page |
num_records |
The total number of records that match the query |
num_pages |
The total number of pages that match the query |
Example
> GET /ga/api/system_campaigns HTTP/1.1
> Authorization: Basic MTozNTZjNTg0ZWM4YWJlMWQ0NDY0OGZlMTY3MmVkM2ZlYmVkYTQxNWRh
> Accept: application/json
> Content-Type: application/json
< Content-Type: application/json; charset=utf-8
< X-UA-Compatible: IE=Edge
< ETag: "427f115a558eb8134d5d20711c6e276e"
< Cache-Control: max-age=0, private, must-revalidate
< Set-Cookie: _session_id=dad8e99250c3941d201628a809cf4f85; path=/; HttpOnly
< X-Request-Id: 827177bb507f40519e575d74b25898e4
< X-Runtime: 0.058486
< Connection: close
< Server: thin 1.5.0 codename Knife
{
"success": true,
"error_code": null,
"error_message": null,
"page": 0,
"per_page": 100,
"data": {
"campaign_report": [
{
"organization": {
"id": 1,
"name": "System Organization"
},
"mailing_list": {
"id": 1,
"name": "Default Mailing List"
},
"campaign": {
"id": 1,
"name": "Default Campaign",
"state": "failed",
"stats": {
"recipients": {
"total": 2,
"sent": 1,
"skip": 1,
"remaining": 1
},
"sent": {
"total": 0,
"accepted": 0,
"bounced": 0,
"in_queue": 0
},
"skip": {
"ssr_failure": 0,
"ssr_request": 1
},
"open": {
"total": 0,
"unique": 0
},
"click": {
"total": 0,
"unique": 0
},
"bounce": {
"total": 0,
"unique": 0,
"hard": 0,
"soft": 0,
"other": 0,
"subscribers_updated": 0
},
"scomp": {
"total": 0,
"unique": 0,
"subscribers_updated": 0
},
"unsub": {
"total": 0,
"unique": 0,
"subscribers_updated": 0
}
}
}
},
{
"organization": {
"id": 1,
"name": "System Organization"
},
"mailing_list": {
"id": 1,
"name": "Default Mailing List"
},
"campaign": {
"id": 2,
"name": "Default Campaign (Duplicate #1)",
"state": "failed",
"stats": {
"recipients": {
"total": 2,
"sent": 1,
"skip": 1,
"remaining": 1
},
"sent": {
"total": 0,
"accepted": 0,
"bounced": 0,
"in_queue": 0
},
"skip": {
"ssr_failure": 0,
"ssr_request": 1
},
"open": {
"total": 0,
"unique": 0
},
"click": {
"total": 0,
"unique": 0
},
"bounce": {
"total": 0,
"unique": 0,
"hard": 0,
"soft": 0,
"other": 0,
"subscribers_updated": 0
},
"scomp": {
"total": 0,
"unique": 0,
"subscribers_updated": 0
},
"unsub": {
"total": 0,
"unique": 0,
"subscribers_updated": 0
}
}
}
}
]
}
}