Media
Access to media is provided to all users who have the appropriate permission in their personal account.
For getting information about media, the following requests are provided:
The list method allows you to get a list of the media
Request:
{site_path}/{lang}/api/media/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 | Media ID |
| name | string | Media name |
| format | int | ID media's size |
| notes | string | Media notes |
| templateID | int | Template ID |
| advertiserID | int | Media advertiser's ID |
| advertiserName | string | Advertiser name |
| typeName | string | Media type |
| assignID | int | ID of the user responsible for the media |
| iabCat | int | ID категории медиа |
| url | int | Click url |
| version | int | Media version |
| created_by | int | Media creator's ID |
| updated_by | int | ID of the last user who edited the media |
| created_at | int | UTC media 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 |
| active | boolean | Media status Values:
|
| tag | array |
Tags |
Response
The response is transmitted in JSON format. List of response fields:
| result | array | List of media based on query parameters |
| _links | array | List of navigation links. May contain the following elements:
|
| _meta | array | Information on list navigation. Contains elements:
|
Request example:
{site_path}/{lang}/api/media/list?filter[id][in][]=1&filter[id][in][]=2&filter[id][in][]=3&filter[name][like]=media&sort=name
Response example:
{
"result": [
{
"id": 1,
"name": "media name",
"format": 1,
"assignID": 0,
"advertiserID": "0",
"templateID": 2,
"typeName": null,
"advertiserName": null,
"notes": " ",
"iabCat": "",
"url": "ccc",
"version": 0,
"created_by": 903,
"updated_by": 903,
"updated_at": 1511438669,
"created_at": 1509720442,
"views": "2",
"viewsToday": "0",
"viewsYtd": "0",
"clicks": "0",
"clicksToday": "0",
"clicksYtd": "0",
"active": "1",
"tag": {
"1": "sport",
"2": "general"
}
},
{
"id": 2,
"name": "another media name",
"format": 197,
"assignID": 0,
"advertiserID": "904",
"templateID": 18,
"typeName": "banner",
"advertiserName": "testadvertiser",
"notes": " notes",
"iabCat": "",
"url": "//media.url",
"version": 1,
"created_by": 903,
"updated_by": 907,
"updated_at": 1575885099,
"created_at": 1509720442,
"views": "5",
"viewsToday": "0",
"viewsYtd": "0",
"clicks": "0",
"clicksToday": "0",
"clicksYtd": "0",
"active": "1",
"tag": {
"2": "general"
}
},
{
"id": 3,
"name": "one more media name",
"format": 55,
"assignID": 0,
"advertiserID": "904",
"templateID": 18,
"typeName": "banner",
"advertiserName": "testadvertiser",
"notes": "",
"iabCat": "",
"url": "http://media.url/",
"version": 1,
"created_by": 903,
"updated_by": 907,
"updated_at": 1560517756,
"created_at": 1509720442,
"views": "2008672583",
"viewsToday": "0",
"viewsYtd": "0",
"clicks": "306212",
"clicksToday": "0",
"clicksYtd": "0",
"active": "0",
"tag": {
"1": "sport"
}
}
],
"_links": {
"self": {
"href": "{site_path}/{lang}/api/media/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&sort=name&page=1"
}
},
"_meta": {
"totalCount": 3,
"pageCount": 1,
"currentPage": 1,
"perPage": 20
}
}
The view method provides extended information about the media
Request:
{site_path}/{lang}/api/media/view/[id]
GET parameters list:
| id | int | It is a required parameter. Media 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 | Media ID |
| name | string | Media name |
| format | int | ID media's size |
| notes | string | Media notes |
| templateID | int | Template ID |
| advertiserID | int | Media advertiser's ID |
| advertiserName | string | Advertiser name |
| typeName | string | Media type |
| assignID | int | ID of the user responsible for the media |
| iabCat | int | ID категории медиа |
| url | int | Click url |
| version | int | Media version |
| created_by | int | Media creator's ID |
| updated_by | int | ID of the last user who edited the media |
| created_at | int | UTC media 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 |
| active | boolean | Media status Values:
|
| campaign | array |
Campaigns related to the media All available campaigns fields you can see on this page |
| tag | array |
Tags |
Request example:
{site_path}/{lang}/api/media/view/2
Response example:
{
"id": 2,
"name": "media name",
"format": 135,
"assignID": 0,
"advertiserID": null,
"templateID": 9,
"typeName": banner,
"advertiserName": name,
"notes": "",
"iabCat": "",
"url": "http://media.url",
"version": 1,
"created_by": 1660984908,
"updated_by": 1839588080,
"updated_at": 1576002408,
"created_at": 1525274553,
"views": null,
"viewsToday": null,
"viewsYtd": null,
"clicks": null,
"clicksToday": null,
"clicksYtd": null,
"active": null,
"campaign": [
{
"id": "1501852",
"name": "campaign name",
"chain": "0",
"priority": "1",
"created_by": "1660984908",
"updated_by": "1839588080",
"created_at": "1525273838",
"updated_at": "1576594907",
"attach_created_by": "1660984908",
"attach_updated_by": "1660984908",
"attach_created_at": "1525274689",
"attach_updated_at": "1562066504",
"views": "53323771",
"viewsToday": "17",
"viewsYtd": "192",
"clicks": "4028",
"clicksToday": "0",
"clicksYtd": "0",
"attached": "1",
"active": "1"
},
{
"id": "2033457146",
"name": "another campaign name",
"chain": "0",
"priority": "1",
"created_by": "1660984908",
"updated_by": "1839588080",
"created_at": "1562066495",
"updated_at": "1576594879",
"attach_created_by": "1660984908",
"attach_updated_by": "1660984908",
"attach_created_at": "1562066495",
"attach_updated_at": "1562066495",
"views": "3098010",
"viewsToday": "5",
"viewsYtd": "14",
"clicks": "393",
"clicksToday": "0",
"clicksYtd": "0",
"attached": "1",
"active": "1"
}
],
"tag": [
{"id": 1, "name": "sport"},
{"id": 2, "name": "general"},
]
}