1.1.1. Tag

GET /tag

get a tag

Get a tag from an id.

Query Parameters
  • id (integer) – Tag id

Example request:

GET /tag HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    A tag object

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "serial": "string",
        "secretKey": "string",
        "timeregistered": "2020-08-27T10:57:29.275611"
    }
    

  • 400 Bad Request

    bad input parameter

    Example response:

    HTTP/1.1 400 Bad Request
    Content-Type: application/json
    
    {}
    

DELETE /tag

delete a tag

delete a tag

Query Parameters
  • id (integer) – Tag id

Status Codes
  • 204 No Content

    Tag has been deleted

    Example response:

    HTTP/1.1 204 No Content
    Content-Type: application/json
    
    {}
    

  • 400 Bad Request

    bad input parameter

    Example response:

    HTTP/1.1 400 Bad Request
    Content-Type: application/json
    
    {}
    

  • 404 Not Found

    No tag found

    Example response:

    HTTP/1.1 404 Not Found
    Content-Type: application/json
    
    {}
    

GET /tags

Get a list of tags ordered by ID.

Get a list of tags

Query Parameters
  • offset (integer) – Return samples starting from this index.

  • limit (integer) – Limit the number of samples returned.

Example request:

GET /tags HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    List of tags

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "id": 1,
            "serial": "string",
            "secretKey": "string",
            "timeregistered": "2020-08-27T10:57:29.275611"
        }
    ]
    

  • 400 Bad Request

    bad input parameter

    Example response:

    HTTP/1.1 400 Bad Request
    Content-Type: application/json
    
    {}
    

POST /tags

create a tag

Create a tag

Example request:

POST /tags HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "id": 1
}
Status Codes
  • 201 Created

    Tag created

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "id": 1,
        "serial": "string",
        "secretKey": "string",
        "timeregistered": "2020-08-27T10:57:29.275611"
    }
    

  • 400 Bad Request

    invalid input, object invalid

    Example response:

    HTTP/1.1 400 Bad Request
    Content-Type: application/json
    
    {}
    

  • 409 Conflict

    a user with the same oauth_id already exists

    Example response:

    HTTP/1.1 409 Conflict
    Content-Type: application/json
    
    {}
    

GET /tagviews

Get a list of TagViews.

Get a list of TagViews.

Query Parameters
  • distinctOnTag (boolean) – Return only the latest TagView for each scanned tag.

  • tag_id (integer) – Filter TagViews by tag_id.

Example request:

GET /tagviews HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    A list of tagview objects ordered from newest to oldest.

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "id": 1,
            "tagserial": "string",
            "timestamp": "2020-08-27T10:57:29.275611"
        }
    ]
    

GET /tagviews/{id}

Get a tagview

Get a tagview

Parameters
  • id (integer) – Tag view ID

Example request:

GET /tagviews/{id} HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    A tagview object

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": 1,
        "tagserial": "string",
        "timestamp": "2020-08-27T10:57:29.275611"
    }
    

  • 404 Not Found

    TagView not found.

    Example response:

    HTTP/1.1 404 Not Found
    Content-Type: application/json
    
    {}
    

DELETE /tagviews/{id}

Delete a tag view

Parameters
  • id (integer) – Tag view ID

Status Codes
  • 204 No Content

    TagView deleted

    Example response:

    HTTP/1.1 204 No Content
    Content-Type: application/json
    
    {}
    

  • 400 Bad Request

    Bad input.

    Example response:

    HTTP/1.1 400 Bad Request
    Content-Type: application/json
    
    {}
    

  • 404 Not Found

    TagView not found

    Example response:

    HTTP/1.1 404 Not Found
    Content-Type: application/json
    
    {}
    

1.1.1.1. Simulate

GET /tag/{id}/simulate

Simulate URL.

Obtain a simulated URL from the tag. This will contain mock sensor data.

Parameters
  • id (integer) – Tag id to simulate

Query Parameters
  • frontendurl (string) – URL of the consumer frontend application that will decode wscodec URLs. (Required)

  • nsamples (integer) – Number of temperature and humidity samples to include in the wscodec URL. 0 samples is valid and should raise an error.

  • smplintervalmins (integer) – Time interval between samples in minutes.

  • format (integer) – Format code e.g. 1 for temperature and humidity and 2 for temperarture samples only.

  • usehmac (boolean) – Use HMAC rather than MD5.

  • batvoltagemv (integer) – Battery voltage in mV.

  • bor (boolean) – Reset caused by Brownout.

  • svsh (boolean) – Reset caused by Supply Voltage Supervisor (High Side).

  • wdt (boolean) – Reset caused by watchdog timer.

  • misc (boolean) – Miscellaneous error flag on cupl Tag.

  • lpm5wu (boolean) – Low Power Mode x.5 wakeup flag.

  • clockfail (boolean) – Clock failure error flag.

  • tagerror (boolean) – Initialise encoder with the error flag set. The circular buffer will be empty.

Example request:

GET /tag/{id}/simulate?frontendurl=string HTTP/1.1
Host: example.com
Status Codes
  • 200 OK

    URL containing sensor data.

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    string
    

  • 400 Bad Request

    bad input parameter

    Example response:

    HTTP/1.1 400 Bad Request
    Content-Type: application/json
    
    {}