Up - API Reference - Home
Requires JWT.
Upload an avatar for the current account. The uploaded avatar is public.
For uploading, we do NOT post JSON, but multipart formdata.
POST /api/account/upload_avatar
Authorization: Bearer <JWT>
Content-Type: multipart/form-data; charset=utf-8; boundary=__GENERATED_MULTIPART_BOUNDARY__
--__GENERATED_MULTIPART_BOUNDARY__
Content-Disposition: form-data; name="upload_file"; filename="avatar.png"
Content-Type: image/jpeg
<avatar.png file data>
--__GENERATED_MULTIPART_BOUNDARY__--
upload_file
the file data for upload.
Authorization: <JWT>
{
"success": true,
"result": {
"user": "<user gid>"
},
"data": {
"cc.users": {
"<user gid>": {
"gid": "<user gid>",
"username": "unicat",
"email": "<user email>",
"name": "Unicat",
"avatar": "<avatar gid>.png",
"status": "active",
"options": {
"language": "en",
"timezone": "Europe/Amsterdam"
}
}
}
}
}
user
is the user gid for the current account.
cc.users
is a dictionary with one entry for the user.
400
Bad request - missing argument
401
Unauthorized - missing or expired JWT
422
Unprocessable entity - invalid file upload