Add new image
Request:
Method:
Params:
Example:
Shell:
Request:
Response:
PHP:
Request:
Response:
/addimageMethod:
POSTParams:
fileName (strimg) - image file name
title (string)
tags (string)
description (string)
url (string)
text (string)
price (string)
button (string)
directory (string) - image directory, default root ("/")
userParams (array) - user definied additional data
privacy (enum) - privacy settings public|private default private
Example:
Shell:
Request:
curl --digest -u demo@bidero.com:b24bdded34e53597a4b0f0fca396492a07979a14 http://api.bildero.com/addimage -F fileName=new.jpg -F 'title=My image' -F 'description=my image added via curl' -F 'url=http://myimage.com/myimages' -F 'text=Additional description' -F 'price=11$' -F 'button=d' -F 'userParams[myparam]=my some param' -F 'userParams[anotherparam]=my another param' -F 'directory=/mypath/'
Response:
<?xml version="1.0"?> <response> <image> <imageStatus>PROCESSING</imageStatus> <imagePath>/new.jpg</imagePath> <imageId>51539607583</imageId> </image> <uploadData> <server>http://upl.f1.s1.bildero.com/upload_image</server> <uid>117</uid> <hash>DEADBEEF</hash> <port>8091</port> <host>f1.s1.bildero.com</host> <zoom>true</zoom> <dest>/new.jpg</dest> <imageid>51539607583</imageid> </uploadData> <status>OK</status> </response>
PHP:
Request:
$postData = array(
'fileName' => 'new2.jpg',
'title' => 'My image',
'description' => 'my image added via php',
'url' => 'http://myimage.com/myimages',
'text' => 'Additional description',
'price' => '11$',
'button' => 'd',
'userParams[myparam]' => 'my some param',
'userParams[anotherparam]' => 'my another param',
'directory' => '/',
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://api.bildero.com/addimage.php');
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
curl_setopt($ch, CURLOPT_USERPWD, 'a8@a.a:84c72af03d5ac7f62b150fc27ef89b5781813db9');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$ret = curl_exec($ch);
curl_close($ch);
print_r(unserialize($ret));
Array
(
[image] => Array
(
[imageStatus] => PROCESSING
[imagePath] => /new2.jpg
[imageId] => 51539607584
[owner] => a8@a.a
)
[uploadData] => Array
(
[server] => http://upl.f1.s1.bildero.com/upload_image
[uid] => 117
[dest] => /new2.jpg
[imageid] => 51539607584
)
[status] => OK
)
