Get
Returns data on associations of images with ads.
Restrictions
Alert
The method only supports text and image ads. To work with all types of ads, use the Ads service in version 5 of the API. More about ad types...
The method response may contain no more than 10,000 associations.
The total number of associations that meet the specified criteria is shown in the TotalObjectsCount output parameter. If the total is more than 10,000, you must use the Limit and Offset parameters to set up paged selection in order to get all the associations.
Input data
The input data structure in JSON is shown below.
{
"method": "AdImageAssociation",
"param": {
/* AdImageAssociationRequest */
"Action": (string),
"SelectionCriteria": {
/* AdImageAssociationSelectionCriteria */
"Logins": [
(string)
...
],
"AdImageHashes": [
(string)
...
],
"StatusAdImageModerate": [
(string)
...
],
"AdIDS": [
(long)
...
],
"CampaignIDS": [
(int)
...
],
"Limit": (int),
"Offset": (int)
}
}
}
Parameters are described below.
Parameter |
Description |
Required |
AdImageAssociationRequest object |
||
|
Action: Get. |
Yes |
|
The |
For agencies |
AdImageAssociationSelectionCriteria object |
||
|
For agencies, an array containing usernames of clients (no more than 10) to perform the operation for. For advertisers, this parameter is ignored. |
For agencies |
|
Array containing the hashes of images (no more than 10,000). |
No |
|
Array of strings containing the moderation status of images:
Selects images with all the statuses listed in the array. |
No |
|
Array of IDs (no more than 10,000) for ads that images are associated with. |
No |
|
Array of IDs (no more than 10,000) for campaigns that images are associated with. |
No |
|
The number of associations in the response. The maximum allowed value is 10,000. If omitted, the limit is 10,000. When combined with the |
No |
|
The number of associations that should be skipped when getting the selection. If omitted, 0 is assumed. When combined with the |
No |
Notes |
||
|
Output data
The output data structure in JSON is shown below.
{
"data": {
/* AdImageAssociationResponse */
"AdImageAssociations": [
{ /* AdImageAssociation */
"AdID": (long),
"AdImageHash": (string),
"Login": (string),
"CampaignID": (int),
"StatusAdImageModerate": (string),
"ModerateRejectionReasons": [
{ /* RejectReason */
"Type": (string),
"Text": (string)
}
...
]
}
...
],
"TotalObjectsCount": (int)
}
}
Parameters are described below.
Parameter |
Description |
AdImageAssociationResponse object |
|
|
Array of |
|
The total number of associations that match the set criteria (without the |
AdImageAssociation object |
|
|
Identifier of the ad that the image is associated with. |
|
Hash of the image. |
|
Username of the image's owner. |
|
The campaign ID. |
|
The image's moderation status:
|
|
Array of |
RejectReason object |
|
|
The type of object that was rejected during moderation: AdImage. |
|
Reason for rejection during moderation. |
Examples of input data
Python
{
'Action': 'Get',
'SelectionCriteria': {
'StatusAdImageModerate': ['Yes'],
'CampaignIDS': [1327944, 1327974],
'Limit': 20,
'Offset': 60
}
}
PHP
array(
'Action' => 'Get',
'SelectionCriteria' => array(
'StatusAdImageModerate' => array('Yes'),
'CampaignIDS' => array(1327944, 1327974),
'Limit' => 20,
'Offset' =60
)
)
Perl
{
'Action' => 'Get',
'SelectionCriteria' ={
'StatusAdImageModerate' => ['Yes'],
'CampaignIDS' => [1327944, 1327974],
'Limit' => 20,
'Offset' =60
}
}