API Return Code Glossary

List of all responses that are known and API Endpoints' returnCode

API Endpoints' Return Code

Each API endpoint has a universal return code if there isn't already a returnCode defined for a response. These returnCode are between 1-999. Currently, there are only 19 numbers as there are 19 HTTP endpoints. (WebSocket is an exception). For some endpoints, the overall returnCode will never show. (e.g. /api/v2/repeaters/beginPairing does have an assigned returnCode, but all responses have specialized response codes since there is no data to be presented.)

API EndpointReturn Code
/api/v2/accesstoken1
/api/v2/accesstoken/generate2
/api/v2/accesstoken/all3
/api/v2/capabilities4
/api/v2/activeorders5
/api/v2/activeorders/{number or UUID}6
/api/v2/activeorders/{name or UUID}/page7
/api/v2/orders8
/api/v2/orders/{UUID}9
/api/v2/statistics10
/api/v2/gateway11
/api/v2/gateway/activate12
/api/v2/gateway/settings13
/api/v2/gateway/check14
/api/v2/repeaters15
/api/v2/repeaters/beginPairing16
/api/v2/repeaters/endPairing17
/api/v2/trackers18
/api/v2/register19

Success/Neutral Responses

These responses are meant to help identify multiple "success" responses (if applicable). All numbers greater than 1000.

Token deleted (DELETE /api/v2/accesstoken)

{
    "status": 200,
    "returnCode": 1001,
    "message": "Token deleted."
}

Paging Canceled (DELETE /api/v2/{number or UUID}/page)

{
    "status": 200,
    "returnCode": 1002,
    "message": "Paging canceled."
}

No Tracker to Cancel (DELETE /api/v2/{number or UUID}/page)

{
    "status": 200,
    "returnCode": 1003,
    "message": "No paged tracker to cancel."
}

Settings Changed (POST /api/v2/gateway/settings)

{
    "status": 200,
    "returnCode": 1004,
    "message": "Settings successfully changed."
}

Registered Client for HTTP WebHook (POST /api/v2/register)

{
    "status": 200,
    "returnCode": 1005,
    "message": "Registered client."
}

Repeaters Inventory Cleared (DELETE /api/v2/repeaters)

{
    "status": 200,
    "returnCode": 1006,
    "message": "Repeater clearing successful."
}

Tracker Inventory Cleared (DELETE /api/v2/trackers)

{
    "status": 200,
    "returnCode": 1007,
    "message":"Tracker inventory cleared."
}

Already Activated Device Code (POST /api/v2/gateway/activate)

{
    "status": 200,
    "returnCode": 1008,
    "message": "Already activated with LRSConnect."
}

Order Already Started (POST /api/v2/activeorders)

{
    "status": 200,
    "returnCode": 1009,
    "message": "Order already started."
}

Order Already Located (POST /api/v2/activeorders)

{
    "status": 200,
    "returnCode": 1010,
    "message": "Order already located."
}

Successfully Activated with Cloud (POST /api/v2/gateway/activate)

{
    "status": 200,
    "returnCode": 1011,
    "message": "Successfully activated with LRSConnect."
}

Repeater Pairing Enabled (POST /api/v2/repeaters/beginPairing)

{
    "status": 200,
    "returnCode": 1012,
    "message": "Gateway listening for repeaters."
}

Repater Pairing Disabled (POST /api/v2/repeaters/endPairing)

{
    "status": 200,
    "returnCode": 1013,
    "message": "Gateway has stopped listening for repeaters."
}

Error Responses

All errors are negative integers so that it can be easily identified. Typically, these responses also have some form of HTTP status error such as 400, 404, 408, or 403.

Malformed Authorization Header

{
    "status": 400,
    "returnCode": -1,
    "message": "Invalid formatted Authorization header value. Must be Bearer ACCESS_TOKEN."
}

Invalid Access Token

{
    "status": 401,
    "returnCode": -2,
    "message": "Access denied using provided token or no access token provided.",
}

Gateway Button Not Pressed or Access Token Generation Time Window Expired

{
    "status": 403,
    "returnCode": -3,
    "message": "Time window expired or gateway button not pressed."
}

Invalid Access Token Name

{
    "status": 400,
    "returnCode": -4,
    "message": "Invalid name for access token. Can only contain letters, numbers, hyphens, and underscores."
}

Unavailable API Endpoint

{
    "status": 404,
    "returnCode": -5,
    "message": "This route does not exist."
}

Order Not Found

{
    "status": 404,
    "returnCode": -6,
    "message": "Order not found."
}

Invalid Order Identifier

{
    "status": 400,
    "returnCode": -7,
    "message": "Invalid order id. Must be an integer or a valid UUID."
}

No Order Name (Number) defined.

{
    "status": 400,
    "returnCode": -8,
    "message": "Missing order name. Must be a positive integer."
}

Invalid Order Name

{
    "status": 400,
    "returnCode": -9,
    "message": "Invalid order name. Must be a positive integer."
}

Invalid Location Name

{
    "status": 400,
    "returnCode": -10,
    "message": "Invalid location name. Must be a positive integer."
}

Order Type Omitted

{
    "status": 400,
    "returnCode": -11,
    "message": "Order type missing from request. Must be either TO_GO or ON_PREMISES."
}

Invalid or Malformed Order Type

{
    "status": 400,
    "returnCode": -12,
    "message": "Order type invalid. Must be either TO_GO or ON_PREMISES."
}

No Tracker bound to Order, so paging unavailable.

{
    "status": 404,
    "returnCode": -13,
    "message": "Tracker of order not found and cannot be paged."
}

No tracker bound to Order, so cancellation of non-existent paging impossible.

{
    "status": 404,
    "returnCode": -14,
    "message": "Unable to cancel paging of a tracker that doesn't exist."
}

Invalid boolean value for refresh parameter (Repeater only)

{
    "status": 400,
    "returnCode": -15,
    "message": "Invalid boolean value for refresh parameter. Must be true or false."
}

Invalid timeout parameter (Connection Check only)

{
    "status": 400,
    "returnCode": -16,
    "message": "Invalid integer value for timeout query parameter. Must be a valid integer between 0-254."
}

Incorrectly formated device code (LRSConnect-Gateway Activation)

{
    "status": 400,
    "returnCode": -17,
    "message": "Malformed device code. Must be in the format of 012-3456-789."
}

Device Code not provided (LRSConnect-Gateway Activation)

{
    "status": 400,
    "returnCode": -18,
    "message": "Missing device code."
}

Invalid device code (Not accepted by LRSConnect)

{
    "status": 400,
    "returnCode": -19,
    "message": "Invalid device code."
}

Invalid or non-existent setting that was attempted to be changed (Gateway Settings)

{
    "status": 400,
    "returnCode": -20,
    "message": "Invalid settings key: {key}"
}

Invalid value for setting that was attempted to be changed (Gateway Settings)

{
    "status": 400,
    "returnCode": -21,
    "message": "Invalid value {value} for key {key}. {msg}"
}

Invalid target_time parameter (Statistics only)

{
    "status": 400,
    "returnCode": -22,
    "message": "Invalid number for target_time."
}

Invalid limit parameter (Orders)

{
    "status": 400,
    "returnCode": -23,
    "message": "Invalid value for limit. Must be a positive integer."
}

Invalid offset parameter (Orders)

{
    "status": 400,
    "returnCode": -24,
    "message": "Invalid value for offset. Must be a positive integer."
}

Invalid date parameter (Orders)

{
    "status": 400,
    "returnCode": -25,
    "message": "Invalid date(s). Provided dates do not match format YYYY-MM-DDTHH:MM:SS."
}

Invalid Order UUID format.

{
    "status": 400,
    "returnCode": -27,
    "message": "Invalid Order UUID. Must be in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX."
}

No http_client property defined (HTTP WebHook)

{
    "status": 400,
    "returnCode": -28,
    "message": "Missing callback URL."
}

Malformed URL provided to http_client (HTTP WebHook)

{
    "status": 400,
    "returnCode": -29,
    "message": "Invalid callback URL."
}

http_client's provided server is not responding to HEAD request (HTTP WebHook)

{
    "status": 404,
    "returnCode": -30,
    "message": "Client provided does not exist or is not responding."
}

Invalid JSON payload. (All POST requests and WebSocket)

{
    "status": 400,
    "returnCode": -31,
    "message": "Invalid json payload."
}

Timeout while waiting for token (WebSockets)

{
    "status": 408,
    "returnCode": -32,
    "message": "Authentication timeout."
}

Generic timeout parameter invalid.

{
    "status": 400,
    "returnCode": -33,
    "message": "Invalid timeout."
}

Out of bound timeout parameter.

{
    "status": 400,
    "returnCode": -34,
    "message": "Timeout out of bounds."
}