Campaigns

Campaigns

Access to campaigns is provided to all users who have the appropriate permission in their personal account.
For getting information about campaigns, the following requests are provided:

The list method allows you to get a list of the campaigns

Request:

{site_path}/{lang}/api/campaign/list

GET parameters list:

filter array Allows filtering data by all available fields
fields string Allows to select only the specified fields from all available
sort string Allows you to sort asc and desc entities by all available fields
page int Allows you to pass the page number of the list of entities

List of all available fields

id int Campaign ID
name string Campaign name
notes string Campaign notes
advertiserID int Campaign advertiser's ID
advertiserName string Advertiser name
assignID int ID of the user responsible for the campaign
active boolean Campaign status
Values:
  • 1 - enabled
  • 0 - disabled
created_by int Campaign creator's ID
updated_by int ID of the last user who edited the campaign
created_at int UTC campaign creation time
updated_at int UTC last edit time
views int Total views
viewsToday int Views for the current day
viewsYtd int Views over the past day
clicks int Total clicks
clicksToday int Clicks for the current day
clicksYtd int Clicks over the past day
tag array Tags

Response

The response is transmitted in JSON format. List of response fields:

result array List of campaigns based on query parameters
_links array List of navigation links. May contain the following elements:
  • self - contains a link to the current page of the list
  • first - contains a link to the first page of the list
  • last - contains a link to the last page of the list
  • prev - contains a link to the previous page of the list
  • next - contains a link to the next page of the list
_meta array Information on list navigation. Contains elements:
  • totalCount - total number of available entities considering all selected parameters
  • pageCount - the sequence number of the entity in the list that starts the current page
  • currentPage - number of the current page
  • perPage - number of entities displayed on one page

Request example:

{site_path}/{lang}/api/campaign/list?filter[id][in][]=1&filter[id][in][]=2&filter[id][in][]=3&filter[name][like]=test&sort=name

Response example:

{
  "result" : [
    {
      "id" : 2,
      "name" : "testadvertiser_adbet_logo",
      "notes" : "",
      "advertiserID" : "904",
      "advertiserName" : "testadvertiser",
      "assignID" : 0,
      "active" : "0",
      "created_by" : 1,
      "updated_by" : 907,
      "created_at" : 0,
      "updated_at" : 1560517823,
      "views" : "2008672583",
      "viewsToday" : "0",
      "viewsYtd" : "0",
      "clicks" : "306212",
      "clicksToday" : "0",
      "clicksYtd" : "0",
      "tag": {
        "2": "general",
      }
    },
    {
      "id" : 3,
      "name" : "testadvertiser_adverserve code 700x270",
      "notes" : "",
      "advertiserID" : "904",
      "advertiserName" : "testadvertiser",
      "assignID" : 0,
      "active" : "1",
      "created_by" : 906,
      "updated_by" : 903,
      "created_at" : 1521734211,
      "updated_at" : 1532513186,
      "views" : "121145798",
      "viewsToday" : "0",
      "viewsYtd" : "0",
      "clicks" : "3431004",
      "clicksToday" : "0",
      "clicksYtd" : "0",
      "tag": {
        "1": "sport",
        "2": "general"
      }
    }
  ],
  "_links" :
  {
    "self" :
      {
      "href" : "{site_path}/{lang}/api/campaign/list?filter%5Bid%5D%5Bin%5D%5B0%5D=1&filter%5Bid%5D%5Bin%5D%5B1%5D=2&filter%5Bid%5D%5Bin%5D%5B2%5D=3&filter%5Bname%5D%5Blike%5D=test&sort=name&page=1"
      }
  },
  "_meta" : {
    "totalCount" : 2,
    "pageCount" : 1,
    "currentPage" : 1,
    "perPage" : 20
  }
}

The view method provides extended information about the campaign.

Request:

{site_path}/{lang}/api/campaign/view/[id]

GET parameters list:

id int It is a required parameter. Campaign number
fields string Allows to select only the specified fields from all available
*Does not apply to related entity fields

List of all available fields

id int Campaign ID
name string Campaign name
notes string Campaign notes
advertiserID int Campaign advertiser's ID
advertiserName string Advertiser name
assignID int ID of the user responsible for the campaign
active boolean Campaign status
Values:
  • 1 - enabled
  • 0 - disabled
created_by int Campaign creator's ID
updated_by int ID of the last user who edited the campaign
created_at int UTC campaign creation time
updated_at int UTC last edit time
views int Total views
viewsToday int Views for the current day
viewsYtd int Views over the past day
clicks int Total clicks
clicksToday int Clicks for the current day
clicksYtd int Clicks over the past day
media array Media related to the campaign
All available media fields you can see on this page
pool array Pools related to the campaign
All available pool fields you can see on this page
tag array Tags

Request example:

{site_path}/{lang}/api/campaign/view/2

Response example:

{
  "id": 2,
  "name": "testadvertiser_adbet_logo",
  "notes": "",
  "advertiserID": null,
  "advertiserName": null,
  "assignID": 0,
  "active": null,
  "created_by": 1,
  "updated_by": 907,
  "created_at": 0,
  "updated_at": 1560517823,
  "views": null,
  "viewsToday": null,
  "viewsYtd": null,
  "clicks": null,
  "clicksToday": null,
  "clicksYtd": null,
  "media": [
    {
      "id": "3",
      "name": "Media name",
      "active": "0",
      "attached": "1",
      "chain": "0",
      "priority": "1",
      "views": "2008672256",
      "viewsToday": "0",
      "viewsYtd": "0",
      "clicks": "306149",
      "clicksToday": "0",
      "clicksYtd": "0",
      "created_by": "903",
      "updated_by": "907",
      "created_at": "1509720442",
      "updated_at": "1560517756",
      "attach_created_by": "0",
      "attach_updated_by": "906",
      "attach_created_at": "0",
      "attach_updated_at": "1527774613"
    },
    {
      "id": "4",
      "name": "another media name",
      "active": "0",
      "attached": "1",
      "chain": "0",
      "priority": "1",
      "views": "0",
      "viewsToday": "0",
      "viewsYtd": "0",
      "clicks": "0",
      "clicksToday": "0",
      "clicksYtd": "0",
      "created_by": "903",
      "updated_by": "906",
      "created_at": "1509720442",
      "updated_at": "1521734441",
      "attach_created_by": "0",
      "attach_updated_by": "906",
      "attach_created_at": "0",
      "attach_updated_at": "1518601987"
    }
  ],
  "pool": [
    {
      "id": "3",
      "name": "pool name",
      "active": "1",
      "attached": "1",
      "chain": "50",
      "priority": "1",
      "views": "2008672932",
      "viewsToday": "0",
      "viewsYtd": "0",
      "clicks": "306212",
      "clicksToday": "0",
      "clicksYtd": "0",
      "created_by": "1",
      "updated_by": "906",
      "created_at": "1431594683",
      "updated_at": "1527606301",
      "attach_created_by": "906",
      "attach_updated_by": "906",
      "attach_created_at": "1521803312",
      "attach_updated_at": "1527774613"
    }
  ],
  "tag": [
    {"id": 1, "name": "sport"},
    {"id": 2, "name": "general"},
  ]
}