GET /api/campaign.php


Request parameters

All parameters must be URL-encoded.


ParameterValue
statusFilter 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.
tagsFilter records by tags. To apply multiple tag filters, include the parameter in query arguments as tags[]=Tag1&tags[]=Tag2.
sort_bySort records by field. At the moment only value created_at is supported, which is also applied by default.
sort_orderSort direction. Possible values are - ASC, DESC. When parameter is omitted, records are sorted in ascending (ASC) order.
limitNumber 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.
pageNumber 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


ParameterValue
idUnique ID of the campaign. Numeric.
nameCampaign name and subject.
templateTemplate used in the campaign. Read "Template object parameters" section for more information.
tagsList of campaign tags.
created_atCreation date. Formatted as YYYY-MM-DD HH:MM:SS.
completed_atCompletion date. Parameter has value only when campaign's status is COMPLETED. Formatted as YYYY-MM-DD HH:MM:SS.
statusStatus. Possible values: DRAFT, PENDING - sending still in progress, COMPLETED, CANCELLED.


Template object parameters


ParameterValue
idTemplate ID. Numeric
nameTemplate name.
preview_urlURL 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"
  }
]