Up - API Reference - Home
Requires JWT.
Update an existing asset by uploading a new file.
For uploading, we do NOT post JSON, but multipart formdata.
POST /api/p/<project gid>/assets/upload_update
Authorization: Bearer <JWT>
Content-Type: multipart/form-data; charset=utf-8; boundary=__GENERATED_MULTIPART_BOUNDARY__
--__GENERATED_MULTIPART_BOUNDARY__
Content-Disposition: form-data; name="asset"
<asset gid>
--__GENERATED_MULTIPART_BOUNDARY__
Content-Disposition: form-data; name="upload_file"; filename="image.jpg"
Content-Type: image/jpeg
<image.jpg file data>
--__GENERATED_MULTIPART_BOUNDARY__--
asset
the asset's gid
upload_file
the file data for upload - this will replace the existing file data
Authorization: <JWT>
{
"success": true,
"result": {
"asset": "<asset gid>"
},
"data": {
"assets": {
"<asset gid>": {
"gid": "<asset gid>",
…
},
"<parent asset gid>": {
"gid": "<parent asset gid>",
…
}
}
}
}
asset
the newly created asset.
assets
Asset info with hierarchy, type, name. Unordered. Includes the parent asset too.
400
Bad request - missing parameters or wrong type or value
401
Unauthorized - missing or expired JWT
403
Forbidden - not a member of this project
422
Unprocessable entity - asset doesn't exist or invalid file upload