Developers » Data API » Rest API » Campaigns » List the campaigns
List the campaigns
All the campaigns
Using our REST API, you can easily list all the campaigns of a site. Here’s the format of the URL:
https://apirest.atinternet-solutions.com/rest/config/v1/campaign/campaigns?keys={siteid:547837}
Once asked, you should fill in your Analytics Suite credentials to login and get access to the campaigns of the site.
Here’s the answer format (JSON array):
[{ "Id": 1, "SiteId": 547837, "Label": "Campaign A", "StartDate": "2013-02-03T10:57:00", "EndDate": null, "SourceId": 32 }, { "Id": 2, "SiteId": 547837, "Label": "Campaign B", "StartDate": "2016-09-07T16:11:00", "EndDate": null, "SourceId": 31 }]
Here are the labels descriptions:
- Id: unique identifier of the campaign;
- SiteId: unique identifier of the site (it matches the one provided in the siteid parameter of the URL);
- Label: campaign label, provided when creating the campaign;
- StartDate: creation date of the campaign;
- EndDate: end date of the campaign, it returns null when the campaign is still active;
- SourceId: campaign type, you may refer to this list to retrieve the Source Label.
Campaigns per traffic source
You may need to list only certain types of campaigns (e.g. only the email campaigns). To do so, use this method to list all the campaign types and get the traffic source IDs you need.
Then, you can all the following URL to filter the campaign per traffic source:
https://apirest.atinternet-solutions.com/rest/config/v1/campaign/campaigns?keys={siteid:547837}&filter={sourceid:{$in:{31,32,33}}}
User Access
All users with standard access are able to use this service. Users with custom access aren’t allowed.
Last update: 22/01/2019