GET /api/campaign.php
Request parameters
All parameters must be URL-encoded.
Parameter | Value |
status | Filter records by status. Possible values are - DRAFT, PENDING, COMPLETED, CANCELLED. To apply multiple status filters, include the parameter in query arguments as status[]=DRAFT&status[]=PENDING. |
tags | Filter records by tags. To apply multiple tag filters, include the parameter in query arguments as tags[]=Tag1&tags[]=Tag2. |
sort_by | Sort records by field. At the moment only value created_at is supported, which is also applied by default. |
sort_order | Sort direction. Possible values are - ASC, DESC. When parameter is omitted, records are sorted in ascending (ASC) order. |
limit | Number of records to return per request. If this parameter has not been provided or has value of 0, then limit is not applied and all records are returned. |
page | Number of records to skip for request. Defaults to 0. Value of 0 returns records from 0 to 10 000, 1 returns records from 10 001 to 20 000, etc. |
Response parameters
Parameter | Value |
id | Unique ID of the campaign. Numeric. |
name | Campaign name and subject. |
template | Template used in the campaign. Read "Template object parameters" section for more information. |
tags | List of campaign tags. |
created_at | Creation date. Formatted as YYYY-MM-DD HH:MM:SS. |
completed_at | Completion date. Parameter has value only when campaign's status is COMPLETED. Formatted as YYYY-MM-DD HH:MM:SS. |
status | Status. Possible values: DRAFT, PENDING - sending still in progress, COMPLETED, CANCELLED. |
Template object parameters
Parameter | Value |
id | Template ID. Numeric |
name | Template name. |
preview_url | URL to template preview. |
Example request
$ curl -X GET -u '[username]:[password]' https://<subdomain>.sendsmaily.net/api/campaign.php
Example response
[
{
"id": 1,
"name": "My first campaign",
"template": {
"id": 19,
"name": "Old template",
"preview_url": "https://<subdomain>.sendsmaily.net/template/preview/id/19"
},
"tags": ["Men"],
"created_at": "2021-01-21 10:00:00",
"completed_at": "2021-01-21 10:05:00",
"status": "COMPLETED"
},
{
"id": 3,
"name": "Offer you cannot refuse",
"template": {
"id": 25,
"name": "New template",
"preview_url": "https://<subdomain>.sendsmaily.net/template/preview/id/25"
},
"tags": ["Women"],
"created_at": "2021-01-21 10:00:00",
"completed_at": null,
"status": "PENDING"
}
]