Upload
Asynchronously uploads images from a list of URLs. The synchronous response contains the numbers of upload tasks.
Input data
The input data structure in JSON is shown below.
{
"method": "AdImage",
"param": {
/* AdImageRequest */
"Action": (string),
"AdImageURLData": [
{ /* AdImageURL */
"Login": (string),
"URL": (string),
"Name": (string)
}
...
]
}
}
Parameters are described below.
Parameter |
Description |
Required |
AdImageRequest object |
||
|
Action: Upload. |
Yes |
|
Array of |
Yes |
AdImageURL object |
||
|
Username of the client who owns the image. For advertisers, this parameter is ignored. |
For agencies |
|
Image link. |
Yes |
|
Caption for the image (any description). |
Yes |
Output data
Alert
An error when creating an upload task (adding to the queue) for one of the images does not cause the entire operation to be canceled and does not affect the successful creation of upload tasks for the other images.
The output data structure in JSON is shown below.
{
"data": {
/* AdImageResponse */
"ActionsResult": [
{ /* AdImageActionResult */
"AdImageUploadTaskID": (int),
"Errors": [
{ /* Error */
"FaultCode": (int),
"FaultString": (string),
"FaultDetail": (string)
}
...
],
}
...
]
}
}
Parameters are described below.
Parameter |
Description |
AdImageResponse object |
|
|
Array of
The items in the array are in the same order as the objects in the |
AdImageActionResult object |
|
|
Number of the created upload task. This number can be used for checking the upload status using the CheckUploadStatus action. |
|
Array of |
Error object |
|
|
Error code. |
|
Textual message about the error. |
|
Detailed description of the reason for the error. |
Examples of input data
Python
{
'Action': 'Upload',
'AdImageURLData': [
{
'Login': 'agrom',
'URL': 'http://site.ru/files/image001.png',
'Name': u'Elephants: new collection'
},
{
'Login': 'agrom',
'URL': 'http://site.ru/files/image002.png',
'Name': u'Elephants: certification and maintenance'
},
{
'Login': 'larry',
'URL': 'http://example.net/files/pic.png',
'Name': u'Stock up on peanuts'
}
]
}
PHP
array(
'Action' => 'Upload',
'AdImageURLData' => array(
array(
'Login' => 'agrom',
'URL' => 'http://site.ru/files/image001.png',
'Name' ='Elephants: new collection'
),
array(
'Login' => 'agrom',
'URL' => 'http://site.ru/files/image002.png',
'Name' ='Elephants: certification and maintenance'
),
array(
'Login' => 'larry',
'URL' => 'http://example.net/files/pic.png',
'Name' ='Stock up on peanuts'
)
)
)
Perl
{
'Action' => 'Upload',
'AdImageURLData' => [
{
'Login' => 'agrom',
'URL' => 'http://site.ru/files/image001.png',
'Name' ='Elephants: new collection'
},
{
'Login' => 'agrom',
'URL' => 'http://site.ru/files/image002.png',
'Name' ='Elephants: certification and maintenance'
},
{
'Login' => 'larry',
'URL' => 'http://example.net/files/pic.png',
'Name' ='Stock up on peanuts'
},
]
}