Website

Create new images collection

Last update: 11.02.2024

POST: https://www.autovit.ro/api/open/imageCollections

Permission: write

Header

Field Type Description
User-Agent string Account email.
X-Bulk-Error string Optional header which allows you to receive errors on response body for each failed image (see examples bellow using value per_item).
The optional header allows the creation of an image collection even if all images but one fail validation. Example: 4 images fail & 1 image passes validation -> Image collection can still be created.

Example request:
		POST /imageCollections HTTP/1.1

User-Agent: $USER_EMAIL
Content-Type: application/json
Authorization: Bearer $ACCESS_TOKEN

{
    "1": "http://lorempixel.com/800/600/transport/",
    "2": "http://lorempixel.com/800/600/transport/",
    "3": "http://lorempixel.com/800/600/transport/"
}			
		
Copied to clipboard

Success 201

Field Type Description
id Number Images collection id
images Object Url's of created images

 

Success response:
		HTTP/1.1 201 Created
{
    "id": "821165355",
    "images":
    {
        "1":
        {
            "0": "http://lorempixel.com/732/488/transport/6/",
            "1": "http://lorempixel.com/148/110/transport/6/",
            "2": "http://lorempixel.com/320/240/transport/6/",
            "3": "http://lorempixel.com/1080/720/transport/6/"
        },
        "2":
        {
            "0": "http://lorempixel.com/732/488/transport/8/",
            "1": "http://lorempixel.com/148/110/transport/8/",
            "2": "http://lorempixel.com/320/240/transport/8/",
            "3": "http://lorempixel.com/1080/720/transport/8/"
        },
        "3":
        {
            "0": "http://lorempixel.com/732/488/transport/2/",
            "1": "http://lorempixel.com/148/110/transport/2/",
            "2": "http://lorempixel.com/320/240/transport/2/",
            "3": "http://lorempixel.com/1080/720/transport/2/"
        }
    }
}			
		
Copied to clipboard
Success response with header X-Bulk-Error="per_item"
		HTTP/1.1 201 Created
{
    "id": "821165355",
    "images":
    {
        "1":
        {
            "0": "http://lorempixel.com/732/488/transport/6/",
            "1": "http://lorempixel.com/148/110/transport/6/",
            "2": "http://lorempixel.com/320/240/transport/6/",
            "3": "http://lorempixel.com/1080/720/transport/6/"
        },
        "2":
        {
            "0": "http://lorempixel.com/732/488/transport/8/",
            "1": "http://lorempixel.com/148/110/transport/8/",
            "2": "http://lorempixel.com/320/240/transport/8/",
            "3": "http://lorempixel.com/1080/720/transport/8/"
        },
        "3":
        {
            "0": "http://lorempixel.com/732/488/transport/2/",
            "1": "http://lorempixel.com/148/110/transport/2/",
            "2": "http://lorempixel.com/320/240/transport/2/",
            "3": "http://lorempixel.com/1080/720/transport/2/"
        }
    },
    "errors": []
}			
		
Copied to clipboard
Error response without header X-Bulk-Error="per_item"
		HTTP/1.1 400 Bad Request
{
    "error":
    {
        "type": "BadRequestException",
        "message": "Remote file not exists"
    }
}			
		
Copied to clipboard
Error response with header X-Bulk-Error="per_item" (one of the images has failed)
		HTTP/1.1 201 Created
{
    "id": "821165355",
    "images":
    {
        "1":
        {
            "0": "http://lorempixel.com/732/488/transport/6/",
            "1": "http://lorempixel.com/148/110/transport/6/",
            "2": "http://lorempixel.com/320/240/transport/6/",
            "3": "http://lorempixel.com/1080/720/transport/6/"
        },
        "3":
        {
            "0": "http://lorempixel.com/732/488/transport/8/",
            "1": "http://lorempixel.com/148/110/transport/8/",
            "2": "http://lorempixel.com/320/240/transport/8/",
            "3": "http://lorempixel.com/1080/720/transport/8/"
        }
    },
    "errors": {
        "2": "Image height must at least 100 px"
     }
}			
		
Copied to clipboard