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

Rule

Conditions that make the Navixy platform log an event and notify someone when a tracker meets them.

A rule is a condition attached to trackers. When a tracker meets it, the platform logs an event and can notify a user about it, which is how speeding, geofence entry, low fuel, or an offline device turn into something a person sees.

A rule exists once and is bound to as many trackers as needed, so rule/create defines the condition and rule/bind decides which trackers it applies to. For a walkthrough, see how to create and use rules.

Rule object

type, param, and extended_params all depend on which rule is being created. Rule types documents them per type, along with the meaning of primary_text and secondary_text. Date, time, and local_time values follow the data types.

API actions

API base path: /tracker/rule.

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


Required sub-user rights: tracker_rule_update.

Bind a rule to trackers

post
/tracker/rule/bind

Apply an existing rule to more trackers.

Trackers that do not exist, belong to someone else, or are deleted are skipped silently rather than failing the call, so a success does not mean every ID in the list was bound.

Requires the tracker_rule_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
rule_idintegerRequired

ID of the rule.

Example: 123
trackersinteger[]Required

Trackers to bind. Unknown or inaccessible IDs are ignored without error.

Example: [265489]
Responses
200

The rule was bound

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

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

{
  "rule_id": 123,
  "trackers": [
    265489
  ]
}
{
  "success": true
}

Errors

These errors come in addition to the general error codes:

  • 201 - No rule with this ID, or it belongs to another user.


Required sub-user rights: tracker_rule_update.

Create a rule

post
/tracker/rule/create

Create a rule and its schedule intervals.

The rule goes in a rule object, not as top-level fields. Sending them flat is rejected with error 7.

Geofence binding differs by type: zone_ids is not allowed for the offline type, and cannot be empty for route or inoutzone. The rule types page documents param, extended_params, and the meaning of primary_text and secondary_text for each type.

Requires the tracker_rule_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
Responses
200

The created rule

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

Example: true
idintegerOptional

ID of the new rule.

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

{
  "rule": {
    "id": 668054,
    "name": "Lock is opened/closed",
    "type": "locking_unlocking",
    "description": "text",
    "zone_ids": [
      18928
    ],
    "trackers": [
      1
    ],
    "primary_text": "text",
    "secondary_text": "text",
    "param": 1,
    "alerts": {
      "sms_phones": [
        "text"
      ],
      "phones": [
        "text"
      ],
      "emails": [
        "text"
      ],
      "push_enabled": true,
      "emergency": true
    },
    "suspended": true,
    "auto_created": true,
    "schedule": [
      {
        "type": "weekly",
        "from": null,
        "to": null,
        "interval_id": 48732
      }
    ],
    "extended_params": {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  }
}
{
  "success": true,
  "id": 123
}

Errors

These errors come in addition to the general error codes:

  • 204 - An associated geofence does not exist.


Required sub-user rights: tracker_rule_update.

Delete a rule

post
/tracker/rule/delete

Delete a rule and everything related to it, including its schedule intervals.

Requires the tracker_rule_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
rule_idintegerRequired

ID of the rule.

Example: 123
Responses
200

The rule was deleted

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

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

{
  "rule_id": 123
}
{
  "success": true
}

Errors

These errors come in addition to the general error codes:

  • 201 - No rule with this ID, or it belongs to another user.


List rules

post
/tracker/rule/list

Get the rules bound to one tracker, or every rule on the account when tracker_id is omitted. Available to demo accounts.

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_idintegerOptional

Optional. Return only rules bound to this tracker. Omit for every rule on the account.

Example: 999199
Responses
200

The rules

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

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

{
  "tracker_id": 999199
}
{
  "success": true,
  "list": [
    {
      "id": 668054,
      "name": "Lock is opened/closed",
      "type": "locking_unlocking",
      "description": "text",
      "zone_id": 0,
      "trackers": [
        1
      ],
      "primary_text": "text",
      "secondary_text": "text",
      "param": 1,
      "alerts": {
        "sms_phones": [
          "text"
        ],
        "phones": [
          "text"
        ],
        "emails": [
          "text"
        ],
        "push_enabled": true,
        "emergency": true
      },
      "suspended": true,
      "auto_created": true,
      "schedule": [
        {
          "type": "weekly",
          "from": null,
          "to": null,
          "interval_id": 48732
        }
      ],
      "extended_params": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      }
    }
  ]
}

Required sub-user rights: tracker_rule_update.

Unbind a rule from trackers

post
/tracker/rule/unbind

Stop applying a rule to the given trackers. As with binding, unknown or inaccessible IDs are ignored without error.

Requires the tracker_rule_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
rule_idintegerRequired

ID of the rule.

Example: 123
trackersinteger[]Required

Trackers to unbind. Unknown or inaccessible IDs are ignored without error.

Example: [265489]
Responses
200

The rule was unbound

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

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

{
  "rule_id": 123,
  "trackers": [
    265489
  ]
}
{
  "success": true
}

Errors

These errors come in addition to the general error codes:

  • 201 - No rule with this ID, or it belongs to another user.


Required sub-user rights: tracker_rule_update.

Update a rule

post
/tracker/rule/update

Replace a rule and its schedule intervals.

The rule goes in a rule object and must carry its id. As with creation, sending the fields flat is rejected.

Requires the tracker_rule_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
Responses
200

The rule was updated

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

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

{
  "rule": {
    "id": 668054,
    "name": "Lock is opened/closed",
    "type": "locking_unlocking",
    "description": "text",
    "zone_ids": [
      18928
    ],
    "trackers": [
      1
    ],
    "primary_text": "text",
    "secondary_text": "text",
    "param": 1,
    "alerts": {
      "sms_phones": [
        "text"
      ],
      "phones": [
        "text"
      ],
      "emails": [
        "text"
      ],
      "push_enabled": true,
      "emergency": true
    },
    "suspended": true,
    "auto_created": true,
    "schedule": [
      {
        "type": "weekly",
        "from": null,
        "to": null,
        "interval_id": 48732
      }
    ],
    "extended_params": {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  }
}
{
  "success": true
}

Errors

These errors come in addition to the general error codes:

  • 201 - No rule with this ID, or it belongs to another user.

  • 204 - A newly associated geofence does not exist.

Last updated

Was this helpful?