Get

Returns a list of images.

Restrictions

The method response may contain no more than 10,000 images.

The total number of images 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 images.

Input data

The input data structure in JSON is shown below.

{
   "method": "AdImage",
   "param": {
      /* AdImageRequest */
      "Action": (string),
      "SelectionCriteria": {
         /* AdImageSelectionCriteria */
         "Logins": [
            (string)
            ...
         ],
         "AdImageHashes": [
            (string)
            ...
         ],
         "Assigned": [
            (string)
            ...
         ],
         "Limit": (int),
         "Offset": (int)
      }
   }
}

Parameters are described below.

Parameter Description Required
AdImageRequest object
Action Action: Get. Yes
SelectionCriteria The AdImageSelectionCriteria object, which contains criteria for selecting images. For agencies
AdImageSelectionCriteria object
Logins

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
AdImageHashes Array containing the hashes of images (no more than 10,000). No
Assigned

Array of strings containing filters for selecting images based on whether they are associated with ads:

  • If it contains the string "Yes", associated images are selected.
  • If it contains the string "No", unassociated images are selected.
  • If it contains both strings or an empty array, filtering is not used, and all images are selected.
No
Limit

The number of images in the response. The maximum allowed value is 10,000. If omitted, the limit is 10,000.

When combined with the Offset parameter, this allows you to organize paginated selections from the database.

No
Offset

The number of images that should be skipped when getting the selection. If omitted, 0 is assumed.

When combined with the Limit parameter, this allows you to organize paginated selections from the database.

No
Notes
  1. For advertisers: If the SelectionCriteria structure is empty, you will get all the images (up to 10,000).
  2. If the SelectionCriteria structure has more than one criterion set, you will get the images that simultaneously match all the criteria. For example, if an agency has set the parameters Logins and Assigned with the "Yes" string, you will get the images belonging to the specified usernames that are associated with ads.

Parameter Description Required
AdImageRequest object
Action Action: Get. Yes
SelectionCriteria The AdImageSelectionCriteria object, which contains criteria for selecting images. For agencies
AdImageSelectionCriteria object
Logins

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
AdImageHashes Array containing the hashes of images (no more than 10,000). No
Assigned

Array of strings containing filters for selecting images based on whether they are associated with ads:

  • If it contains the string "Yes", associated images are selected.
  • If it contains the string "No", unassociated images are selected.
  • If it contains both strings or an empty array, filtering is not used, and all images are selected.
No
Limit

The number of images in the response. The maximum allowed value is 10,000. If omitted, the limit is 10,000.

When combined with the Offset parameter, this allows you to organize paginated selections from the database.

No
Offset

The number of images that should be skipped when getting the selection. If omitted, 0 is assumed.

When combined with the Limit parameter, this allows you to organize paginated selections from the database.

No
Notes
  1. For advertisers: If the SelectionCriteria structure is empty, you will get all the images (up to 10,000).
  2. If the SelectionCriteria structure has more than one criterion set, you will get the images that simultaneously match all the criteria. For example, if an agency has set the parameters Logins and Assigned with the "Yes" string, you will get the images belonging to the specified usernames that are associated with ads.

Output data

The output data structure in JSON is shown below.

{
   "data": {
      /* AdImageResponse */
      "AdImages": [
         {  /* AdImage */
            "Login": (string),
            "AdImageHash": (string),
            "AdImageURL": (string),
            "Name": (string),
            "Assigned": (string)
         }
         ...
      ],
      "TotalObjectsCount": (int)
   }
}

Parameters are described below.

Parameter Description
AdImageResponse object
AdImages Array of AdImage objects containing information about images.
TotalObjectsCount The total number of images that match the set criteria (without the Limit parameter).
AdImage object
Login Username of the image's owner.
AdImageHash Hash of the image.
AdImageURL The link to the uploaded image.
Name Caption (description) for the image.
Assigned Whether the image is assigned to at least one of the client's ads — Yes/No.
Parameter Description
AdImageResponse object
AdImages Array of AdImage objects containing information about images.
TotalObjectsCount The total number of images that match the set criteria (without the Limit parameter).
AdImage object
Login Username of the image's owner.
AdImageHash Hash of the image.
AdImageURL The link to the uploaded image.
Name Caption (description) for the image.
Assigned Whether the image is assigned to at least one of the client's ads — Yes/No.

Examples of input data

Python

{
   'Action': 'Get',
   'SelectionCriteria': {
      'Logins': ['agrom','larry'],
      'Assigned': ['Yes'],
      'Limit': 20,
      'Offset': 60
   }
}

PHP

array(
   'Action' => 'Get',
   'SelectionCriteria' => array(
      'Logins' => array('agrom','larry'),
      'Assigned' => array('Yes'),
      'Limit' => 20,
      'Offset' => 60
   )
)

Perl

{
   'Action' => 'Get',
   'SelectionCriteria' => {
      'Logins' => ['agrom','larry'],
      'Assigned' => ['Yes'],
      'Limit' => 20,
      'Offset' => 60
   }
}