API

Picture Hosting Service

I. Upload Picture

For uploading pictures, you need to make a POST request:

ParameterValue
URL (Action)http://api.picfield.com/upload/YOUR_RESOURCE_CODE
keyYOUR_UPLOAD_KEY
picUploadable file
angelangel for rotation (optional)
sidYour data (optional)
a1, a2, a3, a4, a5Your 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.

II. Delete Picture

In order to delete picture(s), you need to make a POST request:

ParameterValue
URL (Action)http://api.picfield.com/access/YOUR_RESOURCE_CODE
keyYOUR_ACCESS_KEY
signYOUR_ACCESS_SIGN
methoddelete
picspicture1.jpg[,picture2.jpg ... ,pictureN.jpg] *

You will get OK in response if you succeed or an error string if you fail.

* There can be a maximum of 20 pictures in pics parameter.