Unicat API Reference

Up - API Reference - Home


/api/projects/upload_icon

Requires JWT.

Upload an icon for the project. The uploaded icon is public.

For uploading, we do NOT post JSON, but multipart formdata.

Request multipart/form-data

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.

Success response

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",
                
            }
        }
    }
}

result

project is the project gid.

data

cc.projects is a dictionary with one entry for the project.

Error response

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