For the complete documentation index, see llms.txt. This page is also available as Markdown.

Employee avatar

The icon shown for an employee, assigned from the built-in set or uploaded.

An employee's avatar is the icon shown for them in the interface. It cannot be set through employee/update: use avatar/assign to pick one of the built-in icons, or avatar/upload to supply an image.

An uploaded avatar is served from /employee/avatars/, for example https://api.eu.navixy.com/v2/static/employee/avatars/abcdef123456789.png. The upload returns avatar_file_name, which employee/list also returns.

The upload is a multipart request rather than JSON, with the image in a part named file, and its MIME type must be one of image/jpeg, image/pjpeg, image/png, image/gif, or image/webp.

API actions

API base path: /employee/avatar.


Required sub-user rights: employee_update.

Assign employee icon

post
/employee/avatar/assign

Assign an icon from the standard icon set to an employee.

Set icon_id to null to use an uploaded avatar instead of an icon.

Also accepts GET with the same parameters as query-string values.

Requires the employee_update right.

Authorizations
AuthorizationstringRequired

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.

Body
employee_idinteger · min: 1Required

ID of the employee.

icon_idinteger · nullableOptional

Optional. ID of the icon. Null means use the uploaded avatar instead.

Responses
200

Icon assigned

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

Example: true
post/employee/avatar/assign
POST /v2/employee/avatar/assign HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 32

{
  "employee_id": 1,
  "icon_id": null
}
{
  "success": true
}

Errors

These errors come in addition to the general error codes:

  • 201 - Not found in the database - when employee/driver with employee_id not found.


Uploaded avatars become available from /employee/avatars/ e.g. https://api.eu.navixy.com/v2/static/employee/avatars/abcdef123456789.png.

avatar_file_name returned in response and will be returned from /employee/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/jpeg

  • image/pjpeg

  • image/png

  • image/gif

  • image/webp

Required sub-user rights: employee_update.

Upload employee avatar

post
/employee/avatar/upload

Upload an avatar image for an employee.

This is a multipart request, not JSON: multipart/form-data with the image in a part named file.

The returned name is what employee/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 employee_update right.

Authorizations
AuthorizationstringRequired

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.

Body
employee_idintegerRequired

ID of the employee.

filestring · binaryRequired

The image file.

redirect_targetstringOptional

Optional. URL to redirect to after the upload.

Responses
200

The stored avatar

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

Example: true
valuestringOptional

Avatar file name.

post/employee/avatar/upload
POST /v2/employee/avatar/upload HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 58

{
  "employee_id": 1,
  "file": "binary",
  "redirect_target": "text"
}
{
  "success": true,
  "value": "text"
}

Errors

These errors come in addition to the general error codes:

  • 201 - Not found in the database - when employee/driver with employee_id not found.

  • 233 - No data file - if file part not passed.

  • 234 - Invalid data format - if passed file with unexpected mime type.

  • 254 - Cannot save file - on some file system errors.

Last updated

Was this helpful?