Up - API Reference - Home
Requires JWT.
Upload an icon for the project. The uploaded icon 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="project"
<project gid>
--__GENERATED_MULTIPART_BOUNDARY__
Content-Disposition: form-data; name="upload_file"; filename="icon.png"
Content-Type: image/jpeg
<icon.png file data>
--__GENERATED_MULTIPART_BOUNDARY__--
project
the project's gid
- you must be the owner.
upload_file
the file data for upload.
Authorization: <JWT>
{
"success": true,
"result": {
"project": "<project gid>"
},
"data": {
"cc.projects": {
"<project gid>": {
"gid": "<project gid>",
"name": "Project Name",
"icon": "<project gid>.png",
"owner": "<user gid>",
"status": "active",
…
}
}
}
}
project
is the project gid.
cc.projects
is a dictionary with one entry for the project.
400
Bad request - missing argument
401
Unauthorized - missing or expired JWT
403
Forbidden - not the owner of this project
422
Unprocessable entity - invalid file upload or project not found