JSON Response Format

HTTP Responses / JSON Response Format

On this page:
Intro ▾
{{activeSubMenu.text}} ▾

Every request to the Pixaven API will result in a JSON response containing a boolean success property, HTTP status code and associated request id.

Responses to Successful Requests

Upon a successful call, the API will also return metadata for both the input and output (resulting) images. The output hash will always contain a url of the processed image available in our temporary storage, Pixaven Cloud Storage or your External Storage of choice. Please read the section in the API Introduction about downloading processed images.

Within the response JSON you'll also find sha1 hash of both input and output images which might help you to track which images have been already processed with Pixaven API.

Example response for a successful API call:

HTTP/1.1 200 OK

Date: {{now}}
Status: 200 OK
Content-Type: application/json

{
    "success": true,
    "code": 200,
    "id": "9fccf4b5-cfab-4e92-9276-5d2028fcb6a0",
    "input": {
        "name": "image.jpg",
        "format": "JPEG",
        "width": 550,
        "height": 412,
        "colorspace": "YCbCr",
        "interlaced": false,
        "sampling": "4:2:0",
        "depth": 24,
        "quality": 95,
        "bytes": 85285,
        "sha1": "b752df4c53d29212e71eecc08b9cf6c4ab6f0652"
    },
    "output": {
        "url": "https://dl.pixaven.com/9f/cc/f4/b5/cfab-4e92-9276-5d2028fcb6a0/image.jpg",
        "name": "image.jpg",
        "format": "JPEG",
        "width": 300,
        "height": 225,
        "colorspace": "YCbCr",
        "interlaced": true,
        "sampling": "4:2:0",
        "depth": 24,
        "quality": 91,
        "bytes": 29469,
        "sha1": "b91f615ed5e10aa95f94a3e9ab7483f664d7b173"
    }
}

Responses to Failed Requests

In the case of an erroneous call, the success property will be set to false and a descriptive error message will also be provided. If you need to contact us about a specific request, providing the request id will ensure the fastest possible resolution.

HTTP/1.1 422 UNPROCESSABLE ENTITY

Date: {{now}}
Status: 422 UNPROCESSABLE ENTITY
Content-Type: application/json

{
    "success": false,
    "code": 422,
    "id": "c9521e2b-1df6-46b9-9da7-e2de29d96853",
    "message": "Adjust 'contrast' parameter must be an integer within -100 to 100 range"
}

We use both proprietary and third-party cookies to improve your browsing experience and to provide you with a better service. By continuing to use this site you consent our use of cookies as described in our Cookie Policy×