Presigned upload

Get url to upload profile avatar to

Retrieve the url and form data to post profile avatar directly.

GET/me/presigned-upload
Authorization
Response

OK

Body
url*string

URL to post the image to

formData*object
expectedFieldsarray of string
Request
const response = await fetch('/me/presigned-upload', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer jwt"
    },
});
const data = await response.json();
Response
{
  "url": "text",
  "formData": {
    "policy": "eyAiZXhwaXJhdGlvbiI6ICIyMDE1LTEyLTMwVDEyOjAwOjAwLjAwMFoiLA0KICAiY29uZGl0aW9ucyI6IFsNCiAgICB7ImJ1Y2tldCI6ICJzaWd2NGV4YW",
    "x-amz-algorithm": "AWS4-HMAC-SHA256",
    "x-amz-credential": "AKIAIOSFODNN7EXAMPLE/20151229/us-east-1/s3/aws4_request",
    "x-amz-date": "20151229T000000Z",
    "x-amz-signature": "8afdbf4008c03f22c2cd3cdb72e4afbb1f6a588f3255ac628749a66d7f09699e"
  },
  "expectedFields": [
    "text"
  ]
}

Last updated