For uploading pictures, you need to make a POST request:
| Parameter | Value |
|---|---|
| URL (Action) | http://api.picfield.com/upload/YOUR_RESOURCE_CODE |
| key | YOUR_UPLOAD_KEY |
| pic | Uploadable file |
| angel | angel for rotation (optional) |
| sid | Your data (optional) |
| a1, a2, a3, a4, a5 | Your data (optional) |
As a result, you will get the JSON Object:
{"pics":[{"pic":"action1_image_url.jpg","size":BBB},{"pic":"action2_image_url.jpg","size":BBB}, ..., {"pic":"actionN_image_url.jpg","size":BBB} ],"errors":null}
Where
pics - array of pictures for each action, which you defined for resource.
action1_image_url.jpg - is the URL of action's image.
BBB - the image size, in bytes.
errors - the text of the error in case the error occurred.
Server Side > Also, if you defined Notify URL we will make a POST request to your Notify URL script with following data:
pic_1=action1_image_url.jpg
size_1=BBB
id_1=action1_image_id
pic_2=action2_image_url.jpg
size_2=BBB
id_2=action2_image_id
...
pic_N=actionN_image_url.jpg
size_N=BBB
id_N=actionN_image_id
resource=RESOURCE CODE
sid=YOUR OPTIONAL DATA
a1,a2,a3,a4,a5=YOUR OPTIONAL DATA
Attention!
If only your Notify URL script returns response with status = 200 OK, we will send data to Client Side.
Steps in uploading process with Notify URL:
1. Server Side actions.
2. Client Side actions.
In order to delete picture(s), you need to make a POST request:
| Parameter | Value |
|---|---|
| URL (Action) | http://api.picfield.com/access/YOUR_RESOURCE_CODE |
| key | YOUR_ACCESS_KEY |
| sign | YOUR_ACCESS_SIGN |
| method | delete |
| pics | picture1.jpg[,picture2.jpg ... ,pictureN.jpg] * |
You will get OK in response if you succeed or an error string if you fail.