Create Image Upload URL and Token

POST {{baseUrl}}/api/v2/guide/user_images/uploads

Returns an upload URL and token. Use the upload URL in a PUT request to upload the image to the help center. See Uploading the image with the upload URL below.

After uploading the image, use the image token to create the image path. See Create Image Path.

Uploading the image with the upload URL

The endpoint returns an object with the url and headers properties:

"headers": {
  "Content-Disposition": "attachment; filename=\"01GC9JEN2X052BAKW905PH9C36.jpeg\"",
  "Content-Type": "image/jpeg",
  "X-Amz-Server-Side-Encryption": "AES256"
},
...
"url": "https://aus-uploaded-assets-production.s3-accelerate.amazonaws.com/20/13633840/01GC9JEN2X052BAKW905PH9C36?Content-Type=image%2Fjpeg&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ACCESS_KEY%2F20220906%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220906T141448Z&X-Amz-Expires=3600&X-Amz-Signature=476f8f09a97cae0bb582716d54dc58cdfbc754c5e20a2c492515d7ffce954971&X-Amz-SignedHeaders=content-disposition%3Bhost%3Bx-amz-server-side-encryption&x-amz-server-side-encryption=AES256"

To upload the image, make a PUT request to the URL and with the specified headers. Agents, end users, or anonymous users can make the request. The maximum file size is 2MB.

The following curl example uploads the image:

curl -L -X PUT 'https://aus-uploaded-assets-production.s3-accelerate.amazonaws.com/20/13633840/01GC9JEN2X052BAKW905PH9C36?Content-Type=image%2Fjpeg&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ACCESS_KEY%2F20220906%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220906T141448Z&X-Amz-Expires=3600&X-Amz-Signature=476f8f09a97cae0bb582716d54dc58cdfbc754c5e20a2c492515d7ffce954971&X-Amz-SignedHeaders=content-disposition%3Bhost%3Bx-amz-server-side-encryption&x-amz-server-side-encryption=AES256' \
  -H 'Content-Disposition: attachment; filename="01GC9JEN2X052BAKW905PH9C36.jpeg"' \
  -H 'Content-Type: image/jpeg' \
  -H 'X-Amz-Server-Side-Encryption: AES256' \
  --data-binary "@{file}"

A successful response will return:

Status 200 OK

Request Body Format

The request body of POST /api/v2/guide/user_images/uploads must be a JSON object with the following properties:

NameTypeMandatoryDescription
content_typestringtrueThe content type of the file to upload
file_sizenumbertrueSize of the file in bytes. Max size is 2000000 (2MB).

Allowed for

  • Anonymous users

HEADERS

KeyDatatypeRequiredDescription
Acceptstring

RESPONSES

status: OK

{"upload":{"headers":{"ametada":-28627086.139754266,"labore_a5":-46659269.73341108,"Excepteur_fb1":68324107.81681654,"anim_08":false},"token":"\u003cstring\u003e","url":"\u003cstring\u003e"}}