picBox Documentation

API :: Uploading Data

< Back


To push data onto picBox, there are three pieces of information required:

The URL to push data anonymously is:

https://picbox.us/api/push?type=data_type

The URL to push data using an account is:

https://picbox.us/api/push?token=user_token&type=data_type

The data types available are:

Image

When uploading images, it is necessary for the request content-type to be "multipart/form-data", and for the name field's value to be "file".

For example, a request with correct headers might resemble this:

POST /api/push?type=image HTTP/1.1
Host: picbox.us
Accept: */*
Content-Length: 106371
Expect: 100-continue
Content-Type: multipart/form-data; boundary=------------------------b04160b8bde7728a

--------------------------b04160b8bde7728a
Content-Disposition: form-data; name="file"; filename="myimage.jpg"
Content-Type: image/jpeg

.....
An incorrect header would contain something like name="myimagefile" instead of name="file".

The maximum image file size is 90.125 MB.

This endpoint will return a JSON response similar to this:

{
    url: "https://pcbx.us/picBox/attt.jpg",
    id: 1337,
    delete_token: "T7(Pz0BOWv)7LRhu1!9q$tBhb"
}

The delete token returned is used to delete the uploaded image from picBox. It is recommended to store this if you are not using the bind endpoint to list a user's images.