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

Commands

Reusable commands defined on a tracker, sent to the device or to a URL on demand.

A command is a reusable action defined on one tracker and run when someone asks for it. Two kinds exist. A hardware command sends a protocol string straight to the device, to reboot its firmware or toggle a relay. An HTTP command sends a POST request with a JSON body to any URL, optionally carrying live device values in the payload.

Commands are stored per tracker and executed from the Commands block in the interface or through command/execute.

Commands are for manual, on-demand actions on a single tracker. For automated, rule-based sending across many devices, use IoT Logic with the Device action or Webhook nodes.

Command object

The config object takes one of two shapes, chosen by type:

In an HTTP command's body, {{attribute_name}} placeholders are replaced with the device's current values at the moment the command runs.

Dynamic command values

A hardware command's command string, or an HTTP command's body, can carry a single <> placeholder in place of a fixed value. The caller supplies the substitution in param when running the command, and the Navixy platform replaces <> before sending. This lets one stored command cover a family of calls, such as a relay command whose channel number changes per use.

It is a different mechanism from the {{attribute_name}} placeholders above: those read live device values, while <> takes a value from the caller.

  • A configuration may contain at most one <> placeholder. Create and update reject one with more.

  • param is required when the configuration contains a placeholder, and rejected when it does not. Either mismatch returns error 7. A blank value counts as absent.

  • param accepts up to 500 printable characters.

API actions

API base path: /tracker/command. One call, batch_get_commands, sits at the tracker root instead.

Operations that list no errors of their own return only the general error codes.


Required sub-user rights: tracker_update.

Create a command

post
/tracker/command/create

Define a reusable command on a tracker. Commands are stored per tracker and executed on demand.

A tracker holds at most 10 commands, and an eleventh is rejected. Commands cannot be created on a clone device.

A configuration may contain at most one <> placeholder, and one with more than one is rejected. See the dynamic values note on execute.

For automated, rule-based command sending across many devices, use IoT Logic's device action or webhook nodes instead; this family is for manual, single-tracker actions.

Requires the tracker_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
tracker_idintegerRequired

ID of the tracker, also known as the object ID. Must belong to the current account and not be blocked.

Example: 123456
Responses
200

The created command

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

Example: true
idintegerOptional

ID of the new command.

Example: 19
post/tracker/command/create
POST /v2/tracker/command/create HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 123

{
  "tracker_id": 123456,
  "command": {
    "id": 19,
    "name": "Reboot",
    "type": "hardware",
    "config": {
      "command": "cpureset",
      "reliable": true
    }
  }
}
{
  "success": true,
  "id": 19
}

Errors

These errors come in addition to the general error codes:

  • 201 - The command or the tracker does not exist.


Required sub-user rights: tracker_update.

Update a command

post
/tracker/command/update

Replace an existing command. The whole object must be sent, including its id; there is no partial update.

As with create, the configuration may contain at most one <> placeholder, and one with more than one is rejected.

Requires the tracker_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
tracker_idintegerRequired

ID of the tracker, also known as the object ID. Must belong to the current account and not be blocked.

Example: 123456
Responses
200

The command was updated

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

Example: true
post/tracker/command/update
POST /v2/tracker/command/update HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 123

{
  "tracker_id": 123456,
  "command": {
    "id": 19,
    "name": "Reboot",
    "type": "hardware",
    "config": {
      "command": "cpureset",
      "reliable": true
    }
  }
}
{
  "success": true
}

Errors

These errors come in addition to the general error codes:

  • 201 - The command or the tracker does not exist.


Required sub-user rights: tracker_configure, tracker_set_output.

If the command's configuration contains a <> placeholder, pass its value in param. See Dynamic command values.

Execute a command

post
/tracker/command/execute

Run a stored command immediately. A hardware command sends its string to the device; an http command dispatches the POST request with live attribute values substituted into the body.

Dynamic values. Where the command's configuration contains a <> placeholder, the value that replaces it is supplied here as param, and the substitution happens before the command is sent. param is required when the configuration contains a placeholder, and rejected when it does not: either mismatch returns error 7. A blank param counts as absent.

Requires the tracker_configure and tracker_set_output rights.

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
tracker_idintegerRequired

ID of the tracker, also known as the object ID. Must belong to the current account and not be blocked.

Example: 123456
command_idinteger · min: 1Required

ID of the command to run.

Example: 3
paramstring · max: 500Optional

Value that replaces the <> placeholder in the command configuration. Required if the configuration contains one, rejected if it does not. Up to 500 printable characters.

Example: 1
Responses
200

The command was executed

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

Example: true
post/tracker/command/execute
POST /v2/tracker/command/execute HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 48

{
  "tracker_id": 123456,
  "command_id": 3,
  "param": "1"
}
{
  "success": true
}

Errors

These errors come in addition to the general error codes:

  • 201 - The command or the tracker does not exist.


Required sub-user rights: tracker_update.

Delete a command

post
/tracker/command/delete

Remove a stored command from a tracker.

Requires the tracker_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
tracker_idintegerRequired

ID of the tracker, also known as the object ID. Must belong to the current account and not be blocked.

Example: 123456
command_idinteger · min: 1Required

ID of the command to delete.

Example: 5
Responses
200

The command was deleted

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

Example: true
post/tracker/command/delete
POST /v2/tracker/command/delete HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 36

{
  "tracker_id": 123456,
  "command_id": 5
}
{
  "success": true
}

Errors

These errors come in addition to the general error codes:

  • 201 - The command or the tracker does not exist.


Read commands for several trackers

post
/tracker/batch_get_commands

Get the stored commands for the given trackers, grouped by tracker ID. Available to demo accounts.

Omitting trackers returns commands for every tracker the account can reach. Trackers with no commands come back as empty arrays.

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
trackersinteger[]Optional

Optional. Tracker IDs. Omit for every accessible tracker.

Example: [70074765,70074766]
Responses
200

Commands per tracker

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

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

{
  "trackers": [
    70074765,
    70074766
  ]
}
{
  "success": true,
  "result": {
    "ANY_ADDITIONAL_PROPERTY": [
      {
        "id": 19,
        "name": "Reboot",
        "type": "hardware",
        "config": {
          "command": "cpureset",
          "reliable": true
        }
      }
    ]
  }
}

Last updated

Was this helpful?