Tag avatar
Contains API calls to interact with tag avatars.
API actions
API path: /tag/avatar.
assign
Assigns icon_id (from standard icon set) to specified tag.
required sub-user rights: tag_update.
Parameters
tag_id
ID of the tag to assign.
int
icon_id
Icon to assign to tag. Can be null – this means that uploaded avatar should be used instead of icon.
int
Examples
curl -X POST 'https://api.eu.navixy.com/v2/tag/avatar/assign' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "tag_id": 1, "icon_id": 14}'https://api.eu.navixy.com/v2/tag/avatar/assign?hash=a6aa75587e5c59c32d347da438505fc3&tag_id=1&icon_id=14Response
{
"success": true
}Errors
201 – Not found in the database - when vehicle with specified
tag_idnot found.
upload
Uploads avatar image for specified tag.
Then it will be available from [api_base_url]/[api_static_path]/tag/avatars/<file_name>
e.g. https://api.eu.navixy.com/v2/static/tag/avatars/abcdef123456789.png.
required sub-user rights: tag_update.
avatar_file_name returned in response and will be returned from /tag/list.
MUST be a POST multipart request (multipart/form-data), with one of the parts being an image file upload (with the name file).
File part mime type must be one of:
image/jpegimage/pjpegimage/pngimage/gifimage/webp
Parameters
tag_id
ID of the tag to upload.
file
Image file.
redirect_target
Optional. URL to redirect. If redirect_target passed return redirect to <redirect_target>?response=<urlencoded response json>
Response
value- string. Avatar file name.
Errors
201 – Not found in the database - when tag with specified
tag_idnot found.233 – No data file - if
filepart not passed.234 – Invalid data format - if passed
filewith unexpectedmimetype.254 – Cannot save file - on some file system errors.
Last updated
Was this helpful?