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

Tag avatar

The icon shown for a tag, uploaded as an image or assigned from the built-in set.

A tag's avatar is the icon the interface shows for it. There are two ways to set one, and this page has an operation for each: assign one of the Navixy platform's built-in icons, or upload an image of your own.

An uploaded avatar is served from [api_base_url]/[api_static_path]/tag/avatars/<file_name>, for example https://api.eu.navixy.com/v2/static/tag/avatars/abcdef123456789.png. The upload returns avatar_file_name, which tag/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: /tag/avatar.

Every operation on this page requires the tag_update sub-user right.


Assign tag icon

post
/tag/avatar/assign

Assign an icon from the standard icon set to a tag.

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 tag_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
tag_idinteger · min: 1Required

ID of the tag.

icon_idinteger · nullableOptional

Icon to assign. Null means use the uploaded avatar instead of an icon.

Responses
200

Icon assigned

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

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

{
  "tag_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 no tag has the given tag_id.


Upload tag avatar

post
/tag/avatar/upload

Upload an avatar image for a tag.

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>/tag/avatars/<file_name>, and the returned name is also what tag/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 tag_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
tag_idintegerRequired

ID of the tag.

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/tag/avatar/upload
POST /v2/tag/avatar/upload HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 53

{
  "tag_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 no tag has the given tag_id.

  • 233 - No data file, when the file part is missing.

  • 234 - Invalid data format, when the file part has an unexpected MIME type.

  • 254 - Cannot save file, on a file system error.

Last updated

Was this helpful?