cURL
curl --request POST \
--url https://sandbox.circularo.com/api/v1/files/photo \
--header 'Authorization: Bearer <token>' \
--form 'bottom=200' \
--form 'left=0' \
--form 'photo=@document.pdf' \
--form 'right=400' \
--form 'top=0'{
"big": "<string>",
"medium": "<string>",
"nano": "<string>",
"small": "<string>"
}{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 403,
"type": "AUTH:ACCESS_DENIED",
"message": "Access denied",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Files
Upload a profile photo
POST /files/photo
Takes an image and stores it as a profile photo in four sizes at once, answering with the identifier of each. A client then picks whichever size the place it is rendering into needs - an avatar next to a name, a face on a signature - without scaling anything itself.
The image may be cropped on the way in: give the rectangle to keep, in pixels of the image as uploaded, and only that part is stored. All four corners have to be given together or none at all.
This only stores the photo; which photo a user actually shows is set through their own profile.
Token authorization: Authorize using a token — either a session token obtained from login or an API key — to call this endpoint.
cURL
curl --request POST \
--url https://sandbox.circularo.com/api/v1/files/photo \
--header 'Authorization: Bearer <token>' \
--form 'bottom=200' \
--form 'left=0' \
--form 'photo=@document.pdf' \
--form 'right=400' \
--form 'top=0'{
"big": "<string>",
"medium": "<string>",
"nano": "<string>",
"small": "<string>"
}{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 403,
"type": "AUTH:ACCESS_DENIED",
"message": "Access denied",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Authorizations
Body
multipart/form-data
Response
Returns the identifier of each stored size.