Vehicle avatar
The icon shown for a vehicle, assigned from the built-in set or uploaded.
A vehicle's avatar is the icon shown for it in the interface. As with places and employees, it cannot be set through vehicle/update: use avatar/assign to pick one of the built-in icons, or avatar/upload to supply an image.
API actions
API base path: /vehicle/avatar.
Required sub-user rights: vehicle_update.
icon_id can be null, which means the uploaded avatar should be used instead of an icon.
Assign an icon to a vehicle.
Set icon_id to null to use an uploaded avatar instead of an icon.
icon_color is required as well as vehicle_id.
Also accepts GET with the same parameters as query-string values.
Requires the vehicle_update right.
Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.
ID of the vehicle.
ID of the icon. Null means use the uploaded avatar instead.
Icon colour.
Icon assigned
true if request finished successfully.
trueBad request. The response body carries the API-level error code in status.code. Validation failures also include an errors array naming each offending parameter.
Error response object
POST /v2/vehicle/avatar/assign HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 51
{
"vehicle_id": 1,
"icon_id": null,
"icon_color": "text"
}{
"success": true
}Errors
These errors come in addition to the general error codes:
201 - Not found in the database.
Uploads avatar image for specified vehicle.Then it will be available from [api_base_url]/<api_static_path>/vehicle/avatars/<file_name>e.g. https://api.eu.navixy.com/v2/static/vehicle/avatars/abcdef123456789.png.
avatar_file_name returned in response and will be returned from /vehicle/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
If redirect_target passed a return redirect to response=<urlencoded response json>.
Required sub-user rights: vehicle_update.
Upload an avatar image for a vehicle.
This is a multipart request, not JSON: multipart/form-data with the image in a part named file. The file MIME type must be one of image/jpeg, image/pjpeg, image/png, image/gif, or image/webp.
The uploaded image becomes available at <api_base_url>/<api_static_path>/vehicle/avatars/<file_name>, and the returned name is also what vehicle/list reports as avatar_file_name.
If redirect_target is passed, the response is a redirect to that URL with response=<urlencoded response json> appended.
Requires the vehicle_update right.
Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.
Vehicle ID.
The image file.
Optional. URL to redirect to after upload.
The stored avatar
true if request finished successfully.
trueAvatar file name.
Bad request. The response body carries the API-level error code in status.code. Validation failures also include an errors array naming each offending parameter.
Error 234: the file exceeds the size limit. Error 233: the file could not be processed.
Error response object
POST /v2/vehicle/avatar/upload HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 57
{
"vehicle_id": 1,
"file": "binary",
"redirect_target": "text"
}{
"success": true,
"value": "text"
}Errors
These errors come in addition to the general error codes:
201, 233, 234, 254.
Last updated
Was this helpful?