POST /image¶
Scope |
|
Accept |
|
Content-Type |
see example |
This URL allows uploading of images. An image upload request must be a multipart form-data request as specified in RFC 2388.
Note
The maximum image size is 8MB and the supported image formats are: PNG, GIF, BMP and JPG.
All images are converted to JPG with maximum dimensions of 1024x1024 while the aspect ratio is maintained.
On success the server returns map with the name and a unique identifier for that image. The name is taken from the
name
parameter of the Content-Disposition
header.
The unique identifier is then used to either fetch the image via GET /image/{id} or save it with a POST /ad or a PUT /ad/{id} request.
Note
Images which are not saved are removed after 30 minutes.
If the request contains invalid images, the server returns 400 Bad Request with a list of errors.
Errors¶
Code |
Error message |
Description |
---|---|---|
2001 |
invalid argument |
the uploaded image is empty |
2008 |
file too large |
file size exceeds the allowed maximum |
2018 |
invalid image format |
the image format is not PNG, GIF or JPG |
Example¶
POST /image
Accept: application/sellside.image.list-v1+json, application/json
Content-Type: multipart/form-data; boundary=a1b8
--a1b8
Content-Disposition: form-data; name="image1"; filename="logo.png"
Content-Type: application/octet-stream
...image bytes...
--a1b8
200 OK
Content-Type: application/sellside.image.list-v1+json; charset=utf-8
{
"image1": "https://localhost/api/sellside/image/9beac3db90c27aa8476cb880a362ceba/b2c11184b33bdd3e12a1f46152d37a89.jpg"
}