Skip to Content
Chameleon Docs
API referenceUploaded pictures

Create picture upload URL

A URL that accepts one PUT of a picture of one's own, for an hour. Each call makes a new picture ID with a place of its own in the store; complete the upload under that ID once the file is sent. The PUT carries a Content-Type header equal to the answer's limits.contentType, the type named in the request, which the upload is held to.

POST
/api/manuals/{id}/uploads/upload-url

A URL that accepts one PUT of a picture of one's own, for an hour.

Each call makes a new picture ID with a place of its own in the store; complete the upload under that ID once the file is sent. The PUT carries a Content-Type header equal to the answer's limits.contentType, the type named in the request, which the upload is held to.

Authorization

headerx-api-key<token>

Scope: manuals:write

Path Parameters

id*string
Match^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

Request Body

application/json
  1. body
fileName*string
Length1 <= length <= 255
contentType*string
Value in"image/png""image/jpeg""image/webp"

Response Body

The picture's ID and the URL; send the file's bytes as the body of a PUT whose Content-Type is limits.contentType

application/json
  1. response
pictureId*string
Match^[A-Za-z0-9_-]{1,64}$
url*string
Formaturi
method*"PUT"
Value in"PUT"
expiresAt*string
Formatdate-time
limits*
Example Request
curl -X POST 'https://www.chameleonlabs.org/api/manuals/string/uploads/upload-url' \  -H 'Content-Type: application/json' \  -d '{  "fileName": "string",  "contentType": "image/png"}'
Example Response
{  "pictureId": "string",  "url": "http://example.com",  "method": "PUT",  "expiresAt": "2019-08-24T14:15:22Z",  "limits": {    "maximumSizeInBytes": 0,    "contentType": "string"  }}