About

This documentation describes how to use the management API. To access the API you need a token set with the correct access.

header = {
    'Authorization': "<your token>"
}

User Management / Authentication Management / Access Management

Create an user

{
    "page": "auth_create",
    "create": {
        "token": true,
        "appid": false
    },
    "owner": "name of owner or organisation", // required
    "email": "mail@organisation.org", // required
    "valid_days": 365,
    "access": {
        "print": false,
        "sensors": false,
        "loriot": false,
        "rs+read": false,
        "rs+contribute": false,
        "rs+mod": false,
        "management": false
    }
}

List users (with filtering options)

{
    "page": "list_auth",
    "rule": "all", // all, exact, contain
    "filter": {
        "email": "email@organisation.org", // optional whole or part of email
        "owner": "Organisation LLA", // optional whole or part of name
        "id": 1 // optional, exact ID
    }
}

Revokes user, removes access to all levels

{
    "page": "revoke_auth",
    "id": 1
}

Edit an user

{
    "page": "alter_auth",
    "id": 7,
    "create": {
        "token": false,
        "appid": true,
    },
    "access": {
        "print": true,
        "sensors": true,
        "loriot": true,
        "rs+read": true,
        "rs+contribute": true,
        "rs+mod": true,
        "management": true,
    },
    "email": "email@organisation.org",
    "owner": "Organisation LLA"
}

Change expiry of an user. Note it is days relative to time of execution, a value of -1 will mean yesterday, and 30 will mean in one month.

{
    "page": "set_expire_auth",
    "id": 4,
    "valid_days": -1,
}

Sensor Management

List all sensors

{
    "page": "list_sensors"
}

Activates a sensor

{
    "page": "activate_sensor",
    "id": 1
}

Deactivates a sensor

{
    "page": "deactivate_sensor",
    "id": 1
}

Creates a new sensor

{
    "page": "create_sensor",
    "name": "some name"
}

Edit a sensor

{
    "page": "alter_sensor",
    "id": 1,
    "name": "new name", // optional
    "location": "new location", // optional
    "position": { // optional
        "lat": 63.10960,
        "lng": 7.78886,
    }
}

Loriot Rules (IoT) Management

List all Loriot Devices with rules

{
    "page": "list_loriot_rules"
}

Creates a new Loriot Device and rule

{
    "page": "create_loriot_rule",
    "EUI": "001122334455667788", // required, Loriot EUI of device, HEX
    "rule": 2, // required, Rule number
    "comment": "Something about the device", // optional
    "target": 1, // optional, Target number, refers to where it should be injected
    "targetID": 3, // optional, specific ID at Target
    "targetRule": 1, // optional, specific rules for Target
}

Edits a Loriot Device

{
    "page": "edit_loriot_rule",
    "ID": 3, // required
    "rule": 2, // optional
    "comment": "Something about the device", // optional
    "target": 1, // optional
    "targetID": 3, // optional
    "targetRule": 1, // optional
}