IoT Open API Specification v2.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Description
Base URLs:
Authentication
-
HTTP Authentication, scheme: basic userAuth: Username and password for user account
-
HTTP Authentication, scheme: basic basicAuth: Password is your API-Key
-
HTTP Authentication, scheme: basic gatewayAuth: Used by gateways in APIs
- API Key (apiKeyAuth)
- Parameter Name: X-API-Key, in: header.
Auth
Login
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/auth \
-H 'Accept: application/json'
POST /api/v2/auth
Log in a user an get a API-Key. Log in is done with username and password. In case of the user
setting SMS-Verification on login the API-Key is only valid to update the authentication using a PUT request to
the same endpoint with the SMS-Code. In case SMS-Validation is required the nextstep
will be "smslogin".
Example responses
200 Response
{
"token": "2c1914fca4676e201b69bb8d6a24e238"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Wrong username or password | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» token | string | false | none | The generated token |
» nextstep | string | false | none | If the user have 2-FA this is what to do next ('smslogin') |
2-FA Challenge
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/auth \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
PUT /api/v2/auth
Complete a 2FA login for this user with a user-provided challenge response. Note that this has to be authenticated using the token provided in the initial auth response.
Body parameter
{
"challenge": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | false | none |
Example responses
200 Response
{
"token": "string"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» token | string | false | none | The generated token |
Logout
Code samples
# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/auth \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
DELETE /api/v2/auth
Example responses
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | None |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Reset password
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/auth/reset_password \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST /api/v2/auth/reset_password
Send a reset password link to the users email if it exist in the system. The response will always be 200 OK, even when the account is not registered.
Body parameter
{
"email": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
Example responses
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | None |
500 | Internal Server Error | Unexpected error | MessageResponse |
Reset password update
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/auth/reset_password \
-H 'Content-Type: application/json' \
-H 'X-API-Key: API_KEY'
PUT /api/v2/auth/reset_password
Set a new password using the key from the email.
Body parameter
{
"password": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | None |
400 | Bad Request | Bad Request | None |
Log
List logs (deprecated)
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/log/{installation_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/log/{installation_id}
Fetch a log of historic event on MQTT from sensors. Will show values and the matched functions. Deprecated, use V3 version instead. Also supports POST when the topic array is too long.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
from | query | integer | false | Unix time to fetch times from, defaults to now - 24h |
to | query | integer | false | Maximum unix time for log entry, defaults to now |
limit | query | integer | false | Maximum number of results, default and max is 10 000 . The limit is applied to the result |
topics | query | string | false | Filter result on specific topic(s), this parameter can occur more than once inorder to filter on |
Detailed descriptions
limit: Maximum number of results, default and max is 10 000
. The limit is applied to the result
before filtering with matched functions resulting in a smaller set of results after the filter. The limited
result will give you the N-amount of latest results.
topics: Filter result on specific topic(s), this parameter can occur more than once inorder to filter on multiple topics.
Example responses
200 Response
[
{
"id": 123,
"function_id": 7,
"function_type": "switch",
"log_item_type": "functionx",
"name": "Livingroom lamp",
"unit": "",
"icon": "lamp",
"alarm_type": "",
"value": 255,
"timestamp": 1587713503.385,
"value_id": "",
"message": ""
},
{
"id": 657,
"function_id": 12,
"function_type": "door",
"log_item_type": "functionx",
"name": "Door",
"unit": "",
"icon": "door",
"alarm_type": "",
"value": 0,
"timestamp": 1587713433.457,
"value_id": "",
"message": ""
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [LogEntry] | false | none | none |
» id | integer | false | none | Unique identifier |
» function_id | string | false | none | Identifier of function |
» function_type | string | false | none | Type of function |
» log_item_type | string | false | none | If the reference function is a FunctionX or legacy Function. |
» name | string | false | none | Name of the function |
» unit | string | false | none | DEPRECATED |
» icon | string | false | none | Icon from the function |
» alarm_type | string | false | none | DEPRECATED |
» value | number | false | none | The logged value |
» timestamp | number | false | none | Time of event using millisecond precision with decimals on Unix timestamp. |
» value_id | string | false | none | DEPRECATED |
» message | string | false | none | The msg field of the MQTT message if present |
List logs (deprecated) POST
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/log/{installation_id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/log/{installation_id}
Fetch a log of historic event on MQTT from sensors. Will show values and the matched functions. Deprecated, use V3 version instead.
Body parameter
[
"string"
]
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
from | query | integer | false | Unix time to fetch times from, defaults to now - 24h |
to | query | integer | false | Maximum unix time for log entry, defaults to now |
limit | query | integer | false | Maximum number of results, default and max is 10 000 . The limit is applied to the result |
body | body | array[string] | true | Filter result on specific topic(s). |
Detailed descriptions
limit: Maximum number of results, default and max is 10 000
. The limit is applied to the result
before filtering with matched functions resulting in a smaller set of results after the filter. The limited
result will give you the N-amount of latest results.
Example responses
200 Response
[
{
"id": 123,
"function_id": 7,
"function_type": "switch",
"log_item_type": "functionx",
"name": "Livingroom lamp",
"unit": "",
"icon": "lamp",
"alarm_type": "",
"value": 255,
"timestamp": 1587713503.385,
"value_id": "",
"message": ""
},
{
"id": 657,
"function_id": 12,
"function_type": "door",
"log_item_type": "functionx",
"name": "Door",
"unit": "",
"icon": "door",
"alarm_type": "",
"value": 0,
"timestamp": 1587713433.457,
"value_id": "",
"message": ""
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [LogEntry] | false | none | none |
» id | integer | false | none | Unique identifier |
» function_id | string | false | none | Identifier of function |
» function_type | string | false | none | Type of function |
» log_item_type | string | false | none | If the reference function is a FunctionX or legacy Function. |
» name | string | false | none | Name of the function |
» unit | string | false | none | DEPRECATED |
» icon | string | false | none | Icon from the function |
» alarm_type | string | false | none | DEPRECATED |
» value | number | false | none | The logged value |
» timestamp | number | false | none | Time of event using millisecond precision with decimals on Unix timestamp. |
» value_id | string | false | none | DEPRECATED |
» message | string | false | none | The msg field of the MQTT message if present |
List logs V3
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v3beta/log/{installation_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v3beta/log/{installation_id}
Fetch historic MQTT obj messages for an installation. Use filter on topic or time to get some specific data. Support POST when the topic array is too large.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
from | query | integer | false | Unix time to fetch times from, defaults to now - 24h |
to | query | integer | false | Maximum unix time for log entry, defaults to now |
limit | query | integer | false | Maximum number of results, default is 10 000 . |
offset | query | integer | false | Offset the result by this many entries, defaults to 0 |
order | query | string | false | Sort order, either desc (default) or asc |
topics | query | string | false | Filter result on specific topic(s), this parameter can occur more than once inorder to filter on |
Detailed descriptions
topics: Filter result on specific topic(s), this parameter can occur more than once inorder to filter on multiple topics or be a comma separated list.
Example responses
200 Response
{
"count": 0,
"last": 0,
"total": 0,
"data": [
{
"client_id": 0,
"installation_id": 0,
"timestamp": 0,
"value": 0,
"msg": "string",
"topic": "string"
}
]
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» count | integer | false | none | The count of results returned in this result set. |
» last | number | false | none | The unix timestamp (with decimals) for the oldest entry in the data. |
» total | integer | false | none | The total amount of entries with these filter parameters. |
» data | [Status] | false | none | Array of data entries. |
»» client_id | number | false | none | Client-ID used on MQTT |
»» installation_id | number | false | none | Installation-ID for the Client-ID in topic |
»» timestamp | number | false | none | Last values unix timestamp. With decimals for milliseconds. |
»» value | number | false | none | Last value |
»» msg | string | false | none | Msg field from MQTT on this value |
»» topic | string | false | none | Topic where value was reported |
List logs V3 POST
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v3beta/log/{installation_id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v3beta/log/{installation_id}
Fetch historic MQTT obj messages for an installation. Use filter on topic or time to get some specific data.
Body parameter
[
"string"
]
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
from | query | integer | false | Unix time to fetch times from, defaults to now - 24h |
to | query | integer | false | Maximum unix time for log entry, defaults to now |
limit | query | integer | false | Maximum number of results, default is 10 000 . |
offset | query | integer | false | Offset the result by this many entries, defaults to 0 |
order | query | string | false | Sort order, either desc (default) or asc |
body | body | array[string] | true | Filter result on specific topic(s). |
Example responses
200 Response
{
"count": 0,
"last": 0,
"total": 0,
"data": [
{
"client_id": 0,
"installation_id": 0,
"timestamp": 0,
"value": 0,
"msg": "string",
"topic": "string"
}
]
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» count | integer | false | none | The count of results returned in this result set. |
» last | number | false | none | The unix timestamp (with decimals) for the oldest entry in the data. |
» total | integer | false | none | The total amount of entries with these filter parameters. |
» data | [Status] | false | none | Array of data entries. |
»» client_id | number | false | none | Client-ID used on MQTT |
»» installation_id | number | false | none | Installation-ID for the Client-ID in topic |
»» timestamp | number | false | none | Last values unix timestamp. With decimals for milliseconds. |
»» value | number | false | none | Last value |
»» msg | string | false | none | Msg field from MQTT on this value |
»» topic | string | false | none | Topic where value was reported |
Mobile
Register Phone
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/mobile \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/mobile
Register phones firebase token to receive Push
Body parameter
{
"device_id": "string",
"firebase_token": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
Example responses
200 Response
{
"invalid": [],
"messages": [],
"missing": [],
"mobile": {
"device_id": "string",
"firebase_token": "string"
},
"valid": true
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» invalid | array | false | none | none |
» messages | array | false | none | none |
» missing | array | false | none | none |
» mobile | object | true | none | Matching sent data |
»» device_id | string | true | none | none |
»» firebase_token | string | true | none | none |
» valid | boolean | false | none | none |
Get Phones
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/mobile/{user_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/mobile/{user_id}
Get all registered firebase tokens for a user with ID. This endpoint can only be used by special system-accounts authenticated with a predefined username and password.
Example responses
200 Response
[
"string"
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
FunctionX
List FunctionX
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/functionx/{installation_id} \
-H 'Accept: application/json'
GET /api/v2/functionx/{installation_id}
List all FunctionX objects for installation. The type determines how this functions is rendered and what meta-keys are to be expected for that rendering. More meta-keys can be added by the user.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
{metadata-key} | query | string | false | Key => value map to filter functions, wildcard supported in values. Can occur several times. |
type | query | string | false | Type filter for functionX objects |
Example responses
200 Response
[
{
"id": 1,
"installation_id": 1,
"type": "string",
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
}
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [ModelX] | false | none | none |
» id | integer | false | none | Identifier |
» installation_id | integer | true | none | Installations ID |
» type | string | true | none | Type identifier used to look for meta-data |
» meta | object | true | none | Key => value storage of all meta-data, may be empty |
»» key1 | string | false | none | none |
»» key2 | string | false | none | none |
» protected_meta | object | false | none | Key => value storage of meta-data that can be restricted access to by permissions. |
»» key1 | string | false | none | none |
»» key2 | string | false | none | none |
Create FunctionX
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/functionx/{installation_id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST /api/v2/functionx/{installation_id}
Body parameter
{
"installation_id": 1,
"type": "string",
"meta": {
"key1": "string",
"key2": "string"
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
silent | query | boolean | false | Suppress MQTT update notification |
body | body | ModelXNoID | true | none |
Example responses
200 Response
{
"id": 1,
"installation_id": 1,
"type": "string",
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
}
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | ModelX |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Get FunctionX
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/functionx/{installation_id}/{functionx_id} \
-H 'Accept: application/json'
GET /api/v2/functionx/{installation_id}/{functionx_id}
Example responses
200 Response
{
"id": 1,
"installation_id": 1,
"type": "string",
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
}
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | ModelX |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Update Functionx
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/functionx/{installation_id}/{functionx_id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
PUT /api/v2/functionx/{installation_id}/{functionx_id}
Body parameter
{
"installation_id": 1,
"type": "string",
"meta": {
"key1": "string",
"key2": "string"
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
silent | query | boolean | false | Suppress MQTT update notification |
body | body | ModelXNoID | true | none |
Example responses
200 Response
{
"id": 1,
"installation_id": 1,
"type": "string",
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
}
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | ModelX |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Delete FunctionX
Code samples
# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/functionx/{installation_id}/{functionx_id} \
-H 'Accept: application/json'
DELETE /api/v2/functionx/{installation_id}/{functionx_id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
silent | query | boolean | false | Suppress MQTT update notification |
Example responses
200 Response
{
"message": "Deleted"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Resource deleted | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
List Status
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/status/{installation_id} \
-H 'Accept: application/json'
GET /api/v2/status/{installation_id}
Reports of latest value for all topics reported on this installation. The value and timestamp is the last known state. Please note that it takes approximately 5 seconds for a value to propagate to this list after publishing. This endpoint is used to get initial state on startup of applications. Use the POST variant if many topics are requested at the same time.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
topics | query | string | false | Filter result on specific topic, this parameter can occur more than once inorder to filter on multiple topics |
Example responses
200 Response
[
{
"client_id": 100,
"installation_id": 10,
"timestamp": 1569919769.52,
"topic": "100/obj/house/hemma/5/temperature",
"value": 22.1
},
{
"client_id": 100,
"installation_id": 10,
"timestamp": 1573667644.385,
"topic": "100/obj/knx/0/2/4",
"value": 1
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [Status] | false | none | none |
» client_id | number | false | none | Client-ID used on MQTT |
» installation_id | number | false | none | Installation-ID for the Client-ID in topic |
» timestamp | number | false | none | Last values unix timestamp. With decimals for milliseconds. |
» value | number | false | none | Last value |
» msg | string | false | none | Msg field from MQTT on this value |
» topic | string | false | none | Topic where value was reported |
List Status POST
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/status/{installation_id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST /api/v2/status/{installation_id}
Reports of latest value for all topics reported on this installation. The value and timestamp is the last known state. Please note that it takes approximately 5 seconds for a value to propagate to this list after publishing. This endpoint is used to get initial state on startup of applications.
Body parameter
[
"string"
]
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | array[string] | true | Filter result on specific topic(s). |
Example responses
200 Response
[
{
"client_id": 100,
"installation_id": 10,
"timestamp": 1569919769.52,
"topic": "100/obj/house/hemma/5/temperature",
"value": 22.1
},
{
"client_id": 100,
"installation_id": 10,
"timestamp": 1573667644.385,
"topic": "100/obj/knx/0/2/4",
"value": 1
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [Status] | false | none | none |
» client_id | number | false | none | Client-ID used on MQTT |
» installation_id | number | false | none | Installation-ID for the Client-ID in topic |
» timestamp | number | false | none | Last values unix timestamp. With decimals for milliseconds. |
» value | number | false | none | Last value |
» msg | string | false | none | Msg field from MQTT on this value |
» topic | string | false | none | Topic where value was reported |
Get Meta key
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/functionx/{installation_id}/{functionx_id}/meta/{meta_key} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/functionx/{installation_id}/{functionx_id}/meta/{meta_key}
Get the value and protected flag of a particular meta key.
Example responses
200 Response
{
"value": "Hello world",
"protected": false
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
404 Response
{
"message": "Not found"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MetaX |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
404 | Not Found | Not found | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Create Meta key
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/functionx/{installation_id}/{functionx_id}/meta/{meta_key} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/functionx/{installation_id}/{functionx_id}/meta/{meta_key}
Create a given meta_key with the provided value and protected flag.
Body parameter
{
"value": "Hello World",
"protected": false
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
meta_key | path | string | true | Meta key to create |
silent | query | boolean | false | Skip MQTT publish. Defaults to false . |
body | body | MetaX | true | Value of meta key |
Detailed descriptions
silent: Skip MQTT publish. Defaults to false
.
Don't publish an MQTT message indicating updated FunctionX.
Setting this to true
will skip MQTT updated event.
Setting this to false
will send MQTT updated event.
Example responses
200 Response
{
"value": "Hello world",
"protected": false
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
404 Response
{
"message": "Not found"
}
409 Response
{
"message": "duplicate key"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MetaX |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
404 | Not Found | Not found | MessageResponse |
409 | Conflict | Duplicate key | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Update Meta key
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/functionx/{installation_id}/{functionx_id}/meta/{meta_key} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
PUT /api/v2/functionx/{installation_id}/{functionx_id}/meta/{meta_key}
Update a given meta_key with the provided value and protected flag.
Body parameter
{
"value": "Hello World",
"protected": false
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
meta_key | path | string | true | Meta key to create |
silent | query | boolean | false | Skip MQTT publish. Defaults to false . |
create_missing | query | boolean | false | Create the key if it does not exist. Defaults to false . |
body | body | MetaX | true | New value of meta key |
Detailed descriptions
silent: Skip MQTT publish. Defaults to false
.
Don't publish an MQTT message indicating updated FunctionX.
Setting this to true
will skip MQTT updated event.
Setting this to false
will send MQTT updated event.
create_missing: Create the key if it does not exist. Defaults to false
.
Setting this to true
will create the key if it is missing.
Setting this to false
will return 404 if the key does not exist.
Example responses
200 Response
{
"value": "Hello",
"protected": false
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
404 Response
{
"message": "Not found"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MetaX |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
404 | Not Found | Not found | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Delete Meta key
Code samples
# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/functionx/{installation_id}/{functionx_id}/meta/{meta_key} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
DELETE /api/v2/functionx/{installation_id}/{functionx_id}/meta/{meta_key}
Delete the given meta key.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
silent | query | boolean | false | Skip MQTT publish. |
Detailed descriptions
silent: Skip MQTT publish.
Don't publish an MQTT message indicating updated FunctionX.
Setting this to true
will skip MQTT updated event.
Setting this to false
will send MQTT updated event.
Example responses
200 Response
{
"message": "Deleted"
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
404 Response
{
"message": "Not found"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Resource deleted | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
404 | Not Found | Not found | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
DeviceX
List DeviceX
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/devicex/{installation_id} \
-H 'Accept: application/json'
GET /api/v2/devicex/{installation_id}
List all DeviceX objects for installation. DeviceX represents the physical device connected to the system. The meta-keys can hold information that are specific to the connection or properties of the device. For example battery-type or connection channel.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
{metadata-key} | query | string | false | Key => value map to filter functions, wildcard supported in values. Can occur several times. |
type | query | string | false | Type filter for deviceX objects |
Example responses
200 Response
[
{
"id": 1,
"installation_id": 1,
"type": "string",
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
}
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [ModelX] | false | none | none |
» id | integer | false | none | Identifier |
» installation_id | integer | true | none | Installations ID |
» type | string | true | none | Type identifier used to look for meta-data |
» meta | object | true | none | Key => value storage of all meta-data, may be empty |
»» key1 | string | false | none | none |
»» key2 | string | false | none | none |
» protected_meta | object | false | none | Key => value storage of meta-data that can be restricted access to by permissions. |
»» key1 | string | false | none | none |
»» key2 | string | false | none | none |
Create DeviceX
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/devicex/{installation_id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST /api/v2/devicex/{installation_id}
Body parameter
{
"installation_id": 1,
"type": "string",
"meta": {
"key1": "string",
"key2": "string"
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
silent | query | boolean | false | Suppress MQTT update notification |
body | body | ModelXNoID | true | none |
Example responses
200 Response
{
"id": 1,
"installation_id": 1,
"type": "string",
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
}
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | ModelX |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Get DeviceX
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/devicex/{installation_id}/{devicex_id} \
-H 'Accept: application/json'
GET /api/v2/devicex/{installation_id}/{devicex_id}
Example responses
200 Response
{
"id": 10,
"type": "knx",
"meta": {
"device_id": 200,
"manufacturer": "A manufacturer",
"description": "A sensor"
}
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | ModelX |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Update DeviceX
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/devicex/{installation_id}/{devicex_id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
PUT /api/v2/devicex/{installation_id}/{devicex_id}
Body parameter
{
"id": 1,
"installation_id": 1,
"type": "string",
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
silent | query | boolean | false | Suppress MQTT update notification |
body | body | ModelX | true | none |
Example responses
200 Response
{
"id": 1,
"installation_id": 1,
"type": "string",
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
}
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | ModelX |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Delete DeviceX
Code samples
# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/devicex/{installation_id}/{devicex_id} \
-H 'Accept: application/json'
DELETE /api/v2/devicex/{installation_id}/{devicex_id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
silent | query | boolean | false | Suppress MQTT update notification |
Example responses
200 Response
{
"message": "Deleted"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Resource deleted | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Get Meta key
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/devicex/{installation_id}/{devicex_id}/meta/{meta_key} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/devicex/{installation_id}/{devicex_id}/meta/{meta_key}
Get the value and protected flag of a particular meta key.
Example responses
200 Response
{
"value": "Hello world",
"protected": false
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
404 Response
{
"message": "Not found"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MetaX |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
404 | Not Found | Not found | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Create Meta key
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/devicex/{installation_id}/{devicex_id}/meta/{meta_key} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/devicex/{installation_id}/{devicex_id}/meta/{meta_key}
Create a given meta_key with the provided value and protected flag.
Body parameter
{
"value": "Hello World",
"protected": false
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
meta_key | path | string | true | Meta key to create |
silent | query | boolean | false | Skip MQTT publish. Defaults to false . |
body | body | MetaX | true | Value of meta key |
Detailed descriptions
silent: Skip MQTT publish. Defaults to false
.
Don't publish an MQTT message indicating updated DeviceX.
Setting this to true
will skip MQTT updated event.
Setting this to false
will send MQTT updated event.
Example responses
200 Response
{
"value": "Hello world",
"protected": false
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
404 Response
{
"message": "Not found"
}
409 Response
{
"message": "duplicate key"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MetaX |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
404 | Not Found | Not found | MessageResponse |
409 | Conflict | Duplicate key | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Update Meta key
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/devicex/{installation_id}/{devicex_id}/meta/{meta_key} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
PUT /api/v2/devicex/{installation_id}/{devicex_id}/meta/{meta_key}
Update a given meta_key with the provided value and protected flag.
Body parameter
{
"value": "Hello World",
"protected": false
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
meta_key | path | string | true | Meta key to create |
silent | query | boolean | false | Skip MQTT publish. Defaults to false . |
create_missing | query | boolean | false | Create the key if it does not exist. Defaults to false . |
body | body | MetaX | true | New value of meta key |
Detailed descriptions
silent: Skip MQTT publish. Defaults to false
.
Don't publish an MQTT message indicating updated DeviceX.
Setting this to true
will skip MQTT updated event.
Setting this to false
will send MQTT updated event.
create_missing: Create the key if it does not exist. Defaults to false
.
Setting this to true
will create the key if it is missing.
Setting this to false
will return 404 if the key does not exist.
Example responses
200 Response
{
"value": "Hello",
"protected": false
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
404 Response
{
"message": "Not found"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MetaX |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
404 | Not Found | Not found | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Delete Meta key
Code samples
# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/devicex/{installation_id}/{devicex_id}/meta/{meta_key} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
DELETE /api/v2/devicex/{installation_id}/{devicex_id}/meta/{meta_key}
Delete the given meta key.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
silent | query | boolean | false | Skip MQTT publish. |
Detailed descriptions
silent: Skip MQTT publish.
Don't publish an MQTT message indicating updated DeviceX.
Setting this to true
will create the key if it is missing.
Setting this to false
will return 404 if the key does not exist.
Example responses
200 Response
{
"message": "Deleted"
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
404 Response
{
"message": "Not found"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Resource deleted | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
404 | Not Found | Not found | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
InstallationInfo
List installations
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/installationinfo \
-H 'Accept: application/json'
GET /api/v2/installationinfo
Get information about all installations connected to the authenticated user. If the users is an administrator (defined by permissions on the role) all installations for all organizations that the user have access to is returned.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organization_id | query | number | false | Filter the result on organization ID. Can be used several times. |
assigned | query | number | false | Filter result on installations assigned to the current user account. Defaults to true |
Example responses
200 Response
[
{
"id": 10,
"name": "First installation",
"client_id": 1010,
"organization_id": 2,
"capabilities": [
"knx",
"zwave"
],
"assigned": true
},
{
"id": 20,
"name": "Second installation",
"client_id": 1020,
"organization_id": 123,
"capabilities": [
"zigbee"
],
"assigned": false
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [InstallationInfo] | false | none | none |
» capabilities | array | false | none | Capabilities of this installation |
» client_id | integer | false | none | ClientID identifier used on MQTT |
» id | integer | false | none | Identifier used in API:s |
» name | string | false | none | none |
» organization_id | number | false | none | ID of the organization where this installation is placed. |
» assigned | boolean | false | none | Indicates if installation is assigned to the current user account. |
Get Installation Info
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/installationinfo/{client_id} \
-H 'Accept: application/json'
GET /api/v2/installationinfo///{client_id}
Get installation info for specified client_id.
Example responses
200 Response
{
"id": 10,
"name": "First installation",
"client_id": 1010,
"capabilities": [
"knx",
"zwave"
]
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | InstallationInfo |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Schedule
Create schedule
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/schedule/{installation_id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/schedule/{installation_id}
Create schedule, all cron fields defaults to '*' if not in the JSON.
Body parameter
{
"active": true,
"created_at": 0,
"day_of_month": "string",
"day_of_week": "string",
"month": "string",
"hour": "string",
"id": 0,
"installation_id": 0,
"minute": "string",
"topic": "string",
"updated_at": "string",
"value": 0,
"executor": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
installation_id | path | number | true | none |
silent | query | boolean | false | Suppress MQTT update notification |
body | body | Schedule | true | none |
Example responses
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | None |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
List schedules
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/schedule/{installation_id} \
-H 'Accept: application/json'
GET /api/v2/schedule/{installation_id}
List all schedules for installation
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
executor | query | string | false | Filter on executors, defaults to "gateway" |
Example responses
200 Response
[
{
"active": true,
"created_at": 0,
"day_of_month": "string",
"day_of_week": "string",
"month": "string",
"hour": "string",
"id": 0,
"installation_id": 0,
"minute": "string",
"topic": "string",
"updated_at": "string",
"value": 0,
"executor": "string"
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [Schedule] | false | none | none |
» active | boolean | true | none | If the schedule is active or not |
» created_at | integer | false | none | Created date as UNIX-timestamp |
» day_of_month | string | false | none | Comma separated list of days in a month where schedule is run. Indexed by 0, '*' for all days |
» day_of_week | string | false | none | Comma separated list of weekdays where schedule is run. Indexed by 0 (sunday is both 0 and 7), '*' for all days |
» month | string | false | none | Comma separated list of months where the schedule is run. Indexed by 0, '*' fo all months. |
» hour | string | false | none | Hour of the day in 24-hour format or '*' for every hour |
» id | number | false | none | Identifier |
» installation_id | number | true | none | Installation id for the schedule |
» minute | string | false | none | Minute of the hour or '*' for every minute |
» topic | string | true | none | The topic to publish value on |
» updated_at | string | false | none | Updated date as UNIX-timestamp |
» value | number | true | none | Value to set on topic when schedule is run |
» executor | string | false | none | Executor that is expected to run the schedule. Defaults to "gateway". |
Get Schedule
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/schedule/{installation_id}/{schedule_id} \
-H 'Accept: application/json'
GET /api/v2/schedule/{installation_id}/{schedule_id}
Get a single schedule on the installation.
Example responses
200 Response
{
"active": true,
"created_at": 0,
"day_of_month": "string",
"day_of_week": "string",
"month": "string",
"hour": "string",
"id": 0,
"installation_id": 0,
"minute": "string",
"topic": "string",
"updated_at": "string",
"value": 0,
"executor": "string"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Schedule |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Update Schedule
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/schedule/{installation_id}/{schedule_id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
PUT /api/v2/schedule/{installation_id}/{schedule_id}
Body parameter
{
"active": true,
"created_at": 0,
"day_of_month": "string",
"day_of_week": "string",
"month": "string",
"hour": "string",
"id": 0,
"installation_id": 0,
"minute": "string",
"topic": "string",
"updated_at": "string",
"value": 0,
"executor": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
installation_id | path | number | true | none |
silent | query | boolean | false | Suppress MQTT update notification |
body | body | Schedule | true | The new schedule |
Example responses
200 Response
{
"active": true,
"created_at": 0,
"day_of_month": "string",
"day_of_week": "string",
"month": "string",
"hour": "string",
"id": 0,
"installation_id": 0,
"minute": "string",
"topic": "string",
"updated_at": "string",
"value": 0,
"executor": "string"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Schedule |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Delete Schedule
Code samples
# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/schedule/{installation_id}/{schedule_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
DELETE /api/v2/schedule/{installation_id}/{schedule_id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
installation_id | path | number | true | none |
silent | query | boolean | false | Suppress MQTT update notification |
Example responses
200 Response
{
"message": "deleted"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Permissions
List permissions
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/perimission \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/perimission
Retrieve a list of permissions that the authenticated
user have. The list is composed of a string identifying the resource
being blocked/allowed. The resource follows the pattern of MQTT-topics
where '+' and '#' are used as wildcards. Default for permissions
not listed should be false. This means that the list is using explicit
grant for the operation. Some permissions have the installation-id as
prefix. This is for future permission where users may only edit on some
installations etc.
The permissions can be used to limit the UI that the user have depending on what is allowed. Permissions are
also enforced on the backend in all API-calls.
Example responses
200 Response
{
"{permission-identifier}": false,
"functionx/+/add": true,
"functionx/zwave/add": false,
"device/#": true
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» {permission-identifier} | boolean | false | none | none |
Gateway
Gateway Verification
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/gateway/verify/{installation_id} \
-H 'Accept: application/json'
POST /api/v2/gateway/verify/{installation_id}
Used by gateways to verify their credentials and report capabilities to the backend.
Example responses
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | OK (No Content) | None |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Create Gateway Credentials
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/gateway/credentials/{installation_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/gateway/credentials/{installation_id}
Create new credentials for a new gateway or edge client. The response also contains information neeeded to connect to the server.
Note: This will overwrite existing credentials if any."
Example responses
200 Response
{
"client_id": 0,
"installation_id": 0,
"api": "string",
"aam": "string",
"mqtt_broker": "string",
"mqtt_username": "string",
"mqtt_password": "string",
"mqtt_client_id": "string",
"timezone": "string"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | GatewayInformation |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Reset Gateway Credentials
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/gateway/reset/{installation_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/gateway/reset/{installation_id}
Reset the saved credentials for a registered gateway. The gateway will have to renew the credentials to be able to function properly again. This can only be done by the users assigned to the installation that the gateway belongs to.
Example responses
200 Response
{
"message": "Reset"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» message | string | false | none | none |
Get gateway registration policy
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/gateway/registration/policy \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/gateway/registration/policy
Gets the current registration policy
Example responses
200 Response
{
"allow_unregistered": true,
"default_organization_id": 10
}
403 Response
{
"message": "Forbidden"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | GatewayRegistrationPolicy |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
Set gateway registration policy
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/gateway/registration/policy \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
PUT /api/v2/gateway/registration/policy
Updates the current registration policy
Example responses
200 Response
{
"allow_unregistered": true,
"default_organization_id": 10
}
403 Response
{
"message": "Forbidden"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | GatewayRegistrationPolicy |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
User
Update user
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/user \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
PUT /api/v2/user
Update user with new information, role, organization and protected_meta/meta.
Body parameter
{
"id": 0,
"email": "string",
"first_name": "string",
"last_name": "string",
"role": 0,
"sms_login": true,
"mobile": "string",
"note": "string",
"assigned_installations": [],
"organisations": [
0
],
"address": {
"address": "string",
"city": "string",
"country": "string",
"zip": "string"
},
"password": "string",
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
},
"expire_at": 0
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | User | true | none |
Example responses
200 Response
{
"id": 0,
"email": "string",
"first_name": "string",
"last_name": "string",
"role": 0,
"sms_login": true,
"mobile": "string",
"note": "string",
"assigned_installations": [],
"organisations": [
0
],
"address": {
"address": "string",
"city": "string",
"country": "string",
"zip": "string"
},
"password": "string",
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
},
"expire_at": 0
}
400 Response
{
"message": "'name' can not be empty"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | User |
400 | Bad Request | Something in the provided data is missing or malformed. | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Create user
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/user \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/user
Create a new user, assign it to organisations and set the users role.
Body parameter
{
"id": 0,
"email": "string",
"first_name": "string",
"last_name": "string",
"role": 0,
"sms_login": true,
"mobile": "string",
"note": "string",
"assigned_installations": [],
"organisations": [
0
],
"address": {
"address": "string",
"city": "string",
"country": "string",
"zip": "string"
},
"password": "string",
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
},
"expire_at": 0
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | User | true | none |
Example responses
200 Response
{
"id": 0,
"email": "string",
"first_name": "string",
"last_name": "string",
"role": 0,
"sms_login": true,
"mobile": "string",
"note": "string",
"assigned_installations": [],
"organisations": [
0
],
"address": {
"address": "string",
"city": "string",
"country": "string",
"zip": "string"
},
"password": "string",
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
},
"expire_at": 0
}
400 Response
{
"message": "'name' can not be empty"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | User |
400 | Bad Request | Something in the provided data is missing or malformed. | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
List users
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/user \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/user
List all users that the authenticated account have access to.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
{metadata-key} | query | string | false | Key => value map to filter users, wildcard supported in values. Can occur several times. |
organization_id | query | integer | false | Filter the result to specific organization. Can occur several times. |
Example responses
200 Response
[
{
"id": 0,
"email": "string",
"first_name": "string",
"last_name": "string",
"role": 0,
"sms_login": true,
"mobile": "string",
"note": "string",
"assigned_installations": [],
"organisations": [
0
],
"address": {
"address": "string",
"city": "string",
"country": "string",
"zip": "string"
},
"password": "string",
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
},
"expire_at": 0
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [User] | false | none | none |
» id | number | false | none | Identifier |
string | true | none | Email address | |
» first_name | string | true | none | First name |
» last_name | string | true | none | Last name |
» role | integer | true | none | ID of Role applied to the user, see permissions and roles |
» sms_login | boolean | false | none | Set to true forces this user to login in with 2FA using SMS |
» mobile | string | false | none | Mobile phone number for this user |
» note | string | false | none | A free text field for notes about this user |
» assigned_installations | array | false | none | IDs of assigned installations, only available when fetching users |
» organisations | [number] | true | none | IDs of organisations that this user belongs to |
» address | Address | true | none | none |
»» address | string | true | none | Street address |
»» city | string | true | none | City name |
»» country | string | true | none | Country |
»» zip | string | true | none | Zip code of the address |
» password | string | false | none | User password, is only valid when creating new users or updating the authenticated user. |
» meta | object | false | none | Key => value storage of all meta-data, may be empty |
»» key1 | string | false | none | none |
»» key2 | string | false | none | none |
» protected_meta | object | false | none | Key => value storage of meta-data that can be restricted access to by permissions. |
»» key1 | string | false | none | none |
»» key2 | string | false | none | none |
» expire_at | number | false | none | Expire user account at specific date/time. Defaults to 0 (no expiry).An expired account can't log in and are prevented from doing any API requests. The value 0 means no expiry and a negative expiry (-1 ) means expireimmediately. A positive value is a unix timestamp for when the account is supposed to be expired. A special permission is needed to modify the account expiry for accounts. |
Get me
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/user/me \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/user/me
Get my own user account and information regarding it.
Example responses
200 Response
{
"id": 2,
"email": "test@domain.tld",
"first_name": "Test 2",
"last_name": "Test",
"role": 1,
"sms_login": false,
"mobile": "01234567890",
"note": "This is a note",
"organisations": [
2
],
"address": {
"address": "Street 1",
"city": "Cityname",
"country": "Sweden",
"zip": "12345"
},
"meta": {
"key1": "value1",
"key2": "value2"
},
"protected_meta": {
"key3": "value3"
},
"expire_at": 0
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | User |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Update me
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/user/me \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
PUT /api/v2/user/me
Update my own user with new information, role, organization and protected_meta/meta.
Example responses
200 Response
{
"id": 0,
"email": "string",
"first_name": "string",
"last_name": "string",
"role": 0,
"sms_login": true,
"mobile": "string",
"note": "string",
"assigned_installations": [],
"organisations": [
0
],
"address": {
"address": "string",
"city": "string",
"country": "string",
"zip": "string"
},
"password": "string",
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
},
"expire_at": 0
}
400 Response
{
"message": "'name' can not be empty"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | User |
400 | Bad Request | Something in the provided data is missing or malformed. | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Delete me
Code samples
# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/user/me \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
DELETE /api/v2/user/me
Delete my own account and remove connections to installations
Example responses
200 Response
{
"message": "string"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Get user
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/user/{id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/user/{id}
Get user and information regarding it
Example responses
200 Response
{
"id": 2,
"email": "test@domain.tld",
"first_name": "Test 2",
"last_name": "Test",
"role": 1,
"sms_login": false,
"mobile": "01234567890",
"note": "This is a note",
"organisations": [
2
],
"address": {
"address": "Street 1",
"city": "Cityname",
"country": "Sweden",
"zip": "12345"
},
"meta": {
"key1": "value1",
"key2": "value2"
},
"protected_meta": {
"key3": "value3"
},
"expire_at": 0
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | User |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Delete user
Code samples
# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/user/{id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
DELETE /api/v2/user/{id}
Delete user and remove connections to installations
Example responses
200 Response
{
"message": "string"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Get Meta key
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/user/{id}/meta/{meta_key} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/user/{id}/meta/{meta_key}
Get the value and protected flag of a particular meta key.
Example responses
200 Response
{
"value": "Hello world",
"protected": false
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
404 Response
{
"message": "Not found"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MetaX |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
404 | Not Found | Not found | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Create Meta key
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/user/{id}/meta/{meta_key} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/user/{id}/meta/{meta_key}
Create a given meta_key with the provided value and protected flag.
Body parameter
{
"value": "Hello World",
"protected": false
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
meta_key | path | string | true | Meta key to create |
silent | query | boolean | false | Skip MQTT publish. Defaults to false . |
body | body | MetaX | true | Value of meta key |
Detailed descriptions
silent: Skip MQTT publish. Defaults to false
.
Don't publish an MQTT message indicating updated FunctionX.
Setting this to true
will skip MQTT updated event.
Setting this to false
will send MQTT updated event.
Example responses
200 Response
{
"value": "Hello world",
"protected": false
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
404 Response
{
"message": "Not found"
}
409 Response
{
"message": "duplicate key"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MetaX |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
404 | Not Found | Not found | MessageResponse |
409 | Conflict | Duplicate key | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Update Meta key
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/user/{id}/meta/{meta_key} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
PUT /api/v2/user/{id}/meta/{meta_key}
Update a given meta_key with the provided value and protected flag.
Body parameter
{
"value": "Hello World",
"protected": false
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
meta_key | path | string | true | Meta key to create |
silent | query | boolean | false | Skip MQTT publish. Defaults to false . |
create_missing | query | boolean | false | Create the key if it does not exist. Defaults to false . |
body | body | MetaX | true | New value of meta key |
Detailed descriptions
silent: Skip MQTT publish. Defaults to false
.
Don't publish an MQTT message indicating updated FunctionX.
Setting this to true
will skip MQTT updated event.
Setting this to false
will send MQTT updated event.
create_missing: Create the key if it does not exist. Defaults to false
.
Setting this to true
will create the key if it is missing.
Setting this to false
will return 404 if the key does not exist.
Example responses
200 Response
{
"value": "Hello",
"protected": false
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
404 Response
{
"message": "Not found"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MetaX |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
404 | Not Found | Not found | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Delete Meta key
Code samples
# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/user/{id}/meta/{meta_key} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
DELETE /api/v2/user/{id}/meta/{meta_key}
Delete the given meta key.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
meta_key | path | string | true | Meta key to create |
silent | query | boolean | false | Skip MQTT publish. Defaults to false . |
Detailed descriptions
silent: Skip MQTT publish. Defaults to false
.
Don't publish an MQTT message indicating updated FunctionX.
Setting this to true
will skip MQTT updated event.
Setting this to false
will send MQTT updated event.
Example responses
200 Response
{
"message": "Deleted"
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
404 Response
{
"message": "Not found"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Resource deleted | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
404 | Not Found | Not found | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Update Password
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/user/password \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
PUT /api/v2/user/password
Update user password
Body parameter
{
"current_password": "string",
"new_password": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
Example responses
200 Response
{
"message": "string"
}
400 Response
{
"message": "'name' can not be empty"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MessageResponse |
400 | Bad Request | Something in the provided data is missing or malformed. | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Create Token
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/user/{id}/security/token \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/user/{id}/security/token
Create a user token
Body parameter
{
"expires": 1678193578,
"session_timeout": 0,
"name": "List Installation Key",
"permissions": [
"installation/list/all"
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | CreateToken | true | none |
Example responses
200 Response
{
"id": 13,
"type": "user_created",
"expires": 1678193578,
"session_timeout": 0,
"created": 1678193500,
"creator_agent": "Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405",
"name": "List Installation Key",
"last_used": 0,
"current": false,
"token": "abcdefghijklmnopqrstuvwxyz",
"accessed": [
{
"ip": "127.0.0.1",
"agent": "Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405",
"last_accessed": 0
}
],
"permissions": [
"installation/list/all"
]
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Token |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
List Tokens
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/user/{id}/security/token \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/user/{id}/security/token
List all tokens for current user
Example responses
200 Response
[
{
"id": 13,
"type": "user_created",
"expires": 1678193578,
"session_timeout": 0,
"created": 1678193500,
"creator_agent": "Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405",
"name": "List Installation Key",
"last_used": 0,
"current": false,
"token": "abcdefghijklmnopqrstuvwxyz",
"accessed": [
{
"ip": "127.0.0.1",
"agent": "Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405",
"last_accessed": 0
}
],
"permissions": [
"installation/list/all"
]
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [Token] | false | none | none |
» id | number | false | none | token id |
» type | string | false | none | token type (eg: user_created) |
» expires | number | false | none | Expiration time for this token |
» session_timeout | number | false | none | How long after last use this token will expire, 0 means expire will not be changed |
» created | number | false | none | when the token was created |
» creator_agent | string | false | none | User-Agent of the application that created the token |
» name | string | false | none | User friendly name |
» last_used | number | false | none | when the token was last used |
» current | boolean | false | none | Indicates if this is the token used for the api call |
» token | string | false | none | Generated token (only available when creating a new token) |
» accessed | [object] | false | none | none |
»» ip | string | false | none | ip address of host that used the token |
»» agent | string | false | none | User-Agent of the client that used the token |
»» last_accessed | number | false | none | Last time when this host used this token |
» permissions | [string] | false | none | list of permissions valid for this token (cannot overreach the users own permissions) |
Delete token
Code samples
# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/user/{id}/security/token/{token_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
DELETE /api/v2/user/{id}/security/token/{token_id}
Delete user token
Example responses
200 Response
{
"message": "string"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Organization
List Organization
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/organization \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/organization
List of all organizations that the user has access to.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
minimal | query | boolean | false | Set to true if the result should be simplified |
Example responses
200 Response
[
{
"id": 0,
"name": "string",
"address": {
"address": "string",
"city": "string",
"country": "string",
"zip": "string"
},
"email": "string",
"phone": "string",
"force_sms_login": true,
"parent": 0,
"children": [
{
"name": 0,
"id": 0
}
],
"notes": "string",
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
},
"password_valid_days": 0
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Create Organization
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/organization \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/organization
Create a new organization and put it in the correct place in the tree.
Body parameter
{
"id": 0,
"name": "string",
"address": {
"address": "string",
"city": "string",
"country": "string",
"zip": "string"
},
"email": "string",
"phone": "string",
"force_sms_login": true,
"parent": 0,
"children": [
{
"name": 0,
"id": 0
}
],
"notes": "string",
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
},
"password_valid_days": 0
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | Organization | true | none |
Example responses
200 Response
{
"id": 0,
"name": "string",
"address": {
"address": "string",
"city": "string",
"country": "string",
"zip": "string"
},
"email": "string",
"phone": "string",
"force_sms_login": true,
"parent": 0,
"children": [
{
"name": 0,
"id": 0
}
],
"notes": "string",
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
},
"password_valid_days": 0
}
400 Response
{
"message": "'name' can not be empty"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Organization |
400 | Bad Request | Something in the provided data is missing or malformed. | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Get organization
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/organization/{id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/organization/{id}
Get a single organization and the ID:s of its children and parent. Parent is set to 0
if this is
the topmost organization that the authenticated account has access to.
Example responses
200 Response
{
"id": 0,
"name": "string",
"address": {
"address": "string",
"city": "string",
"country": "string",
"zip": "string"
},
"email": "string",
"phone": "string",
"force_sms_login": true,
"parent": 0,
"children": [
{
"name": 0,
"id": 0
}
],
"notes": "string",
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
},
"password_valid_days": 0
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Organization |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Update organization
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/organization/{id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
PUT /api/v2/organization/{id}
Update parameters for an organization to the provided data
Example responses
200 Response
{
"id": 2,
"name": "My org 1",
"address": {
"address": "Street 1",
"city": "Stockholm",
"country": "Sweden",
"zip": 12345
},
"email": "contact@myorg.com",
"phone": "07312312345",
"force_sms_login": false,
"parent": 1,
"children": [
{
"id": 4,
"name": "Some name"
},
{
"id": 7,
"name": "Other org"
}
],
"notes": "This is my most valued customer",
"meta": {
"key1": "value1",
"key2": "value2"
}
}
400 Response
{
"message": "'name' can not be empty"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Organization |
400 | Bad Request | Something in the provided data is missing or malformed. | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Delete Organization
Code samples
# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/organization/{id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
DELETE /api/v2/organization/{id}
Deletes an organization. Only empty and leaf organizations can be deleted.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
force | query | string | false | If present, the call will attempt to remove any attached resources before removing the organization. |
Detailed descriptions
force: If present, the call will attempt to remove any attached resources before removing the organization.
*** Attached resources: Files, Installations, Notification Output/Messages, Devices, Functions, and would-be dangling users. Respective permission to remove the resources is required.
Example responses
200 Response
{
"message": "Deleted"
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
409 Response
{
"message": "the organization has sub-organizations"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Resource deleted | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
409 | Conflict | Resources still attached | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Force password reset
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/organization/{id}/force_password_reset \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/organization/{id}/force_password_reset
Force password reset for all users from this organization and all sub-organizations recursively.
Example responses
200 Response
{
"id": 0,
"name": "string",
"address": {
"address": "string",
"city": "string",
"country": "string",
"zip": "string"
},
"email": "string",
"phone": "string",
"force_sms_login": true,
"parent": 0,
"children": [
{
"name": 0,
"id": 0
}
],
"notes": "string",
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
},
"password_valid_days": 0
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Organization |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Get Meta key
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/organization/{id}/meta/{meta_key} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/organization/{id}/meta/{meta_key}
Get the value and protected flag of a particular meta key.
Example responses
200 Response
{
"value": "Hello world",
"protected": false
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
404 Response
{
"message": "Not found"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MetaX |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
404 | Not Found | Not found | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Create Meta key
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/organization/{id}/meta/{meta_key} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/organization/{id}/meta/{meta_key}
Create a given meta_key with the provided value and protected flag.
Body parameter
{
"value": "Hello World",
"protected": false
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
meta_key | path | string | true | Meta key to create |
silent | query | boolean | false | Skip MQTT publish. Defaults to false . |
body | body | MetaX | true | Value of meta key |
Detailed descriptions
silent: Skip MQTT publish. Defaults to false
.
Don't publish an MQTT message indicating updated FunctionX.
Setting this to true
will skip MQTT updated event.
Setting this to false
will send MQTT updated event.
Example responses
200 Response
{
"value": "Hello world",
"protected": false
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
404 Response
{
"message": "Not found"
}
409 Response
{
"message": "duplicate key"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MetaX |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
404 | Not Found | Not found | MessageResponse |
409 | Conflict | Duplicate key | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Update Meta key
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/organization/{id}/meta/{meta_key} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
PUT /api/v2/organization/{id}/meta/{meta_key}
Update a given meta_key with the provided value and protected flag.
Body parameter
{
"value": "Hello World",
"protected": false
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
meta_key | path | string | true | Meta key to create |
silent | query | boolean | false | Skip MQTT publish. Defaults to false . |
create_missing | query | boolean | false | Create the key if it does not exist. Defaults to false . |
body | body | MetaX | true | New value of meta key |
Detailed descriptions
silent: Skip MQTT publish. Defaults to false
.
Don't publish an MQTT message indicating updated FunctionX.
Setting this to true
will skip MQTT updated event.
Setting this to false
will send MQTT updated event.
create_missing: Create the key if it does not exist. Defaults to false
.
Setting this to true
will create the key if it is missing.
Setting this to false
will return 404 if the key does not exist.
Example responses
200 Response
{
"value": "Hello",
"protected": false
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
404 Response
{
"message": "Not found"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MetaX |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
404 | Not Found | Not found | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Delete Meta key
Code samples
# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/organization/{id}/meta/{meta_key} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
DELETE /api/v2/organization/{id}/meta/{meta_key}
Delete the given meta key.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
meta_key | path | string | true | Meta key to create |
silent | query | boolean | false | Skip MQTT publish. Defaults to false . |
Detailed descriptions
silent: Skip MQTT publish. Defaults to false
.
Don't publish an MQTT message indicating updated FunctionX.
Setting this to true
will skip MQTT updated event.
Setting this to false
will send MQTT updated event.
Example responses
200 Response
{
"message": "Deleted"
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
404 Response
{
"message": "Not found"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Resource deleted | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
404 | Not Found | Not found | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Edge Apps
Get Edge App Publisher
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/edge/publisher/{organization_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/edge/publisher/{organization_id}
Get a publisher (organization ID) with their published edge apps.
Example responses
200 Response
{
"id": 0,
"name": "string",
"apps": [
{
"id": 0,
"name": "string",
"category": "string",
"tags": [
"string"
],
"short_description": "string",
"description": "string",
"publisher": {
"name": "string",
"id": 0
},
"official": true,
"public": true,
"source_url": "string",
"created": 0,
"updated": 0
}
]
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | EdgeAppPublisher |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
List Edge Apps
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/edge/app \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/edge/app
List of all published apps that this user have access to.
Example responses
200 Response
[
{
"id": 0,
"name": "string",
"category": "string",
"tags": [
"string"
],
"short_description": "string",
"description": "string",
"publisher": {
"name": "string",
"id": 0
},
"official": true,
"public": true,
"source_url": "string",
"created": 0,
"updated": 0
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [EdgeApp] | false | none | none |
» id | number | false | none | Identifier. |
» name | string | true | none | Name of the app. |
» category | string | true | none | The category that the app is placed in. |
» tags | [string] | true | none | All tags set for this app. |
» short_description | string | true | none | A shorter description for the app |
» description | string | true | none | A longer and more detailed description. Markdown format is allowed to do rich text formatting. |
» publisher | object | true | none | Information about the organization that published the app. |
»» name | string | false | none | Name of the organization publishing the app |
»» id | number | true | none | Identifier of the organization |
» official | boolean | false | none | Set to true if this is an official app. |
» public | boolean | true | none | If tha app is made for all users or just the provided publisher. |
» source_url | string | false | none | Where the source code is available online. |
» created | number | false | none | Unix-timestamp of creation |
» updated | number | false | none | Unix-timestamp of last modified. |
Create Edge App
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/edge/app \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/edge/app
Create a new Edge App entry.
Body parameter
{
"id": 0,
"name": "string",
"category": "string",
"tags": [
"string"
],
"short_description": "string",
"description": "string",
"publisher": {
"name": "string",
"id": 0
},
"official": true,
"public": true,
"source_url": "string",
"created": 0,
"updated": 0
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | EdgeApp | true | none |
Example responses
200 Response
{
"id": 0,
"name": "string",
"category": "string",
"tags": [
"string"
],
"short_description": "string",
"description": "string",
"publisher": {
"name": "string",
"id": 0
},
"official": true,
"public": true,
"source_url": "string",
"created": 0,
"updated": 0
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | EdgeApp |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Update Edge App
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/edge/app \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
PUT /api/v2/edge/app
Update name, description etc for an edge app
Body parameter
{
"id": 0,
"name": "string",
"category": "string",
"tags": [
"string"
],
"short_description": "string",
"description": "string",
"publisher": {
"name": "string",
"id": 0
},
"official": true,
"public": true,
"source_url": "string",
"created": 0,
"updated": 0
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | EdgeApp | true | none |
Example responses
200 Response
{
"id": 0,
"name": "string",
"category": "string",
"tags": [
"string"
],
"short_description": "string",
"description": "string",
"publisher": {
"name": "string",
"id": 0
},
"official": true,
"public": true,
"source_url": "string",
"created": 0,
"updated": 0
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | EdgeApp |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
List Edge Apps Organization
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/edge/app/organization/{organization_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/edge/app/organization/{organization_id}
List all edge apps created by or available for installations in the organization
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organization_id | path | boolean | true | ID for an organization the user has access to |
available | query | boolean | false | If the response contain all available apps or only published |
Example responses
200 Response
[
{
"id": 0,
"name": "string",
"category": "string",
"tags": [
"string"
],
"short_description": "string",
"description": "string",
"publisher": {
"name": "string",
"id": 0
},
"official": true,
"public": true,
"source_url": "string",
"created": 0,
"updated": 0
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [EdgeApp] | false | none | none |
» id | number | false | none | Identifier. |
» name | string | true | none | Name of the app. |
» category | string | true | none | The category that the app is placed in. |
» tags | [string] | true | none | All tags set for this app. |
» short_description | string | true | none | A shorter description for the app |
» description | string | true | none | A longer and more detailed description. Markdown format is allowed to do rich text formatting. |
» publisher | object | true | none | Information about the organization that published the app. |
»» name | string | false | none | Name of the organization publishing the app |
»» id | number | true | none | Identifier of the organization |
» official | boolean | false | none | Set to true if this is an official app. |
» public | boolean | true | none | If tha app is made for all users or just the provided publisher. |
» source_url | string | false | none | Where the source code is available online. |
» created | number | false | none | Unix-timestamp of creation |
» updated | number | false | none | Unix-timestamp of last modified. |
Get Edge App
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/edge/app/{app_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/edge/app/{app_id}
Get a single app identified by id.
Example responses
200 Response
{
"id": 0,
"name": "string",
"category": "string",
"tags": [
"string"
],
"short_description": "string",
"description": "string",
"publisher": {
"name": "string",
"id": 0
},
"official": true,
"public": true,
"source_url": "string",
"created": 0,
"updated": 0
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | EdgeApp |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Download Edge App
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/edge/app/{app_id}/download?version=string \
-H 'Accept: application/json'
GET /api/v2/edge/app/{app_id}/download
Download the executable code for the specified app and version. The response contains all code from the lua-file.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
app_id | path | number | true | none |
version | query | string | true | none |
Example responses
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | None |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
List Edge App Versions
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/edge/app/{app_id}/version \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/edge/app/{app_id}/version
List all versions for the specified app.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
app_id | path | number | true | none |
untagged | query | boolean | false | Set to true if all un-named versions should be included |
Example responses
200 Response
[
{
"name": "string",
"hash": "string",
"timestamp": 0
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [EdgeAppVersion] | false | none | none |
» name | string | false | none | Visible name for the version |
» hash | string | true | none | Hash to set the version name for |
» timestamp | number | false | none | The unix-timestamp for the upload of the version |
Create Edge App Version
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/edge/app/{app_id}/version \
-H 'Content-Type: multipart/form-data' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/edge/app/{app_id}/version
Create a new (un-named) version of an app.
Body parameter
app_json: string
app_lua: string
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
app_id | path | number | true | none |
body | body | object | true | none |
» app_json | body | string(binary) | false | none |
» app_lua | body | string(binary) | false | none |
Example responses
200 Response
{
"hash": "string"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
204 | No Content | No Content. The provided files where identical to the latest on the server. | None |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» hash | string | false | none | The hash of the new version. |
Name Edge App Version
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/edge/app/{app_id}/publish \
-H 'Content-Type: application/json' \
-H 'Accept: appication/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/edge/app/{app_id}/publish
Set the name of an Edge App version, this makes it available for download and is considered published.
Body parameter
{
"name": "string",
"hash": "string",
"timestamp": 0
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
app_id | path | number | true | none |
body | body | EdgeAppVersion | true | none |
Example responses
200 Response
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | EdgeAppVersion |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Get Edge App Configuration Options
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/edge/app/{app_id}/configure?version=string \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/edge/app/{app_id}/configure
Fetch the guide configuration options for a specific version of an app. This will return the uploaded app.json file with the options for how this app is going to be configured.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
app_id | path | number | true | none |
version | query | string | true | Must be one of the available versions or a hash that don't have a name. |
Example responses
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | None |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
List Configured Edge Apps
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/edge/app/configured/{installation_id} \
-H 'Accept: application/json'
GET /api/v2/edge/app/configured/{installation_id}
List all configured apps for an installation.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
installation_id | path | number | true | none |
Example responses
200 Response
[
{
"id": 0,
"app_id": 0,
"installation_id": 0,
"version": "string",
"config": {},
"name": "string",
"created": 0,
"updated": 0
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [EdgeAppConfig] | false | none | none |
» id | number | false | none | Identifier. |
» app_id | number | true | none | Identifier of the app being configured. |
» installation_id | number | true | none | Identifier of the installation being configured. |
» version | string | true | none | Version number for the app being configured. |
» config | object | true | none | All config parameters set by the user. |
» name | string | true | none | User defined name for this instance of the app. |
» created | number | false | none | Unix-timestamp of creation |
» updated | number | false | none | Unix-timestamp of last modified. |
Create Edge App Instance
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/edge/app/configured/{installation_id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/edge/app/configured/{installation_id}
Save a configuration in the backend and inform the gateway that a new app is available for download and run.
Body parameter
{
"id": 0,
"app_id": 0,
"installation_id": 0,
"version": "string",
"config": {},
"name": "string",
"created": 0,
"updated": 0
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
silent | query | boolean | false | Suppress MQTT update notification |
installation_id | path | number | true | none |
body | body | EdgeAppConfig | true | none |
Example responses
200 Response
{
"id": 0,
"app_id": 0,
"installation_id": 0,
"version": "string",
"config": {},
"name": "string",
"created": 0,
"updated": 0
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | EdgeAppConfig |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Get Edge App Instance
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/edge/app/configured/{installation_id}/{instance_id} \
-H 'Accept: application/json'
GET /api/v2/edge/app/configured/{installation_id}/{instance_id}
Returns a single instance of an app as configured by the user.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
installation_id | path | number | true | none |
instance_id | path | number | true | The id of this specific configuration of an app. |
Example responses
200 Response
{
"id": 0,
"app_id": 0,
"installation_id": 0,
"version": "string",
"config": {},
"name": "string",
"created": 0,
"updated": 0
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | EdgeAppConfig |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Update Edge App Instance
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/edge/app/configured/{installation_id}/{instance_id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
PUT /api/v2/edge/app/configured/{installation_id}/{instance_id}
Update the configured app with new parameters and new values. The update will stop the app and deploy it again on the gateway. If the app-version is changed the new version will be downloaded and replace the old version.
Body parameter
{
"id": 0,
"app_id": 0,
"installation_id": 0,
"version": "string",
"config": {},
"name": "string",
"created": 0,
"updated": 0
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
installation_id | path | number | true | none |
instance_id | path | number | true | The id of this specific configuration of an app. |
silent | query | boolean | false | Suppress MQTT update notification |
body | body | EdgeAppConfig | true | none |
Example responses
200 Response
{
"id": 0,
"app_id": 0,
"installation_id": 0,
"version": "string",
"config": {},
"name": "string",
"created": 0,
"updated": 0
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | EdgeAppConfig |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Remove Edge App Instance
Code samples
# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/edge/app/configured/{installation_id}/{instance_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
DELETE /api/v2/edge/app/configured/{installation_id}/{instance_id}
Remove the configuration for an app and inform the gateway that the app should be stopped and removed.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
installation_id | path | number | true | none |
instance_id | path | number | true | The id of this specific configuration of an app. |
silent | query | boolean | false | Suppress MQTT update notification |
Example responses
200 Response
{
"message": "deleted"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Roles
List Roles
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/role \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/role
Returns a list of all roles that the authenticated user can access.
Example responses
200 Response
[
{
"id": 1,
"name": "string",
"permissions": {},
"priority": 0
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [Role] | false | none | none |
» id | integer | false | none | Role identifier. |
» name | string | true | none | Descriptive name of the role. |
» permissions | object | true | none | Associative map of permission to allowed (true/false). |
» priority | number | true | none | Limiting access for role assignment. |
Create Role
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/role \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/role
Create a new Role with a set of permissions.
Body parameter
{
"id": 1,
"name": "string",
"permissions": {},
"priority": 0
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | Role | true | none |
Example responses
200 Response
{
"id": 1,
"name": "string",
"permissions": {},
"priority": 0
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Role |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Get Role
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/role/{role_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/role/{role_id}
Returns a single role identified by role_id
Example responses
200 Response
{
"id": 1,
"name": "string",
"permissions": {},
"priority": 0
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Role |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Update Role
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/role/{role_id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
PUT /api/v2/role/{role_id}
Update parameters for a role to the provided data
Body parameter
{
"id": 1,
"name": "string",
"permissions": {},
"priority": 0
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | Role | true | none |
Example responses
200 Response
{
"id": 1,
"name": "string",
"permissions": {},
"priority": 0
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Role |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Delete Role
Code samples
# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/role/{role_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
DELETE /api/v2/role/{role_id}
Delete a role identified by role_id
Example responses
200 Response
{
"message": "string"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Notifications
List notification messages
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/notification/{installation_id}/message \
-H 'Accept: application/json'
GET /api/v2/notification/{installation_id}/message
Returns a list of messages for given installation
Example responses
200 Response
[
{
"name": "My message",
"text": "{{.installation.Name}} says: {{.payload.message}}"
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [NotificationMessage] | false | none | none |
» id | integer | true | none | Message identifier. |
» name | string | true | none | A friendly name for this message. |
» text | string | true | none | Body of message. Golang templates are supported. |
Create notification message
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/notification/{installation_id}/message \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/notification/{installation_id}/message
Creates a notification message
Body parameter
{
"name": "My message",
"text": "{{.installation.Name}} says: {{.payload.message}}"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | NotificationMessage | true | none |
Example responses
200 Response
{
"name": "My message",
"text": "{{.installation.Name}} says: {{.payload.message}}"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | NotificationMessage |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Get notification message
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/notification/{installation_id}/message/{message_id} \
-H 'Accept: application/json'
GET /api/v2/notification/{installation_id}/message/{message_id}
Returns a message of given id in given installation
Example responses
200 Response
{
"name": "My message",
"text": "{{.installation.Name}} says: {{.payload.message}}"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | NotificationMessage |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Update notification message
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/notification/{installation_id}/message/{message_id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
PUT /api/v2/notification/{installation_id}/message/{message_id}
Updates a notification message
Body parameter
{
"name": "My message",
"text": "{{.installation.Name}} says: {{.payload.message}}"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | NotificationMessage | true | none |
Example responses
200 Response
{
"name": "My message",
"text": "{{.installation.Name}} says: {{.payload.message}}"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | NotificationMessage |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Delete notification message
Code samples
# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/notification/{installation_id}/message/{message_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
DELETE /api/v2/notification/{installation_id}/message/{message_id}
Deletes a notification in given installation
Example responses
200 Response
{
"message": "Deleted"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Resource deleted | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
List notification outputs
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/notification/{installation_id}/output \
-H 'Accept: application/json'
GET /api/v2/notification/{installation_id}/output
Returns a list of notification outputs for given installation
Example responses
200 Response
[
{
"id": 2,
"name": "Mail notification",
"notification_output_executor_id": 1,
"notification_message_id": 1,
"config": {
"recipients": "recipient1@server.com, recipient2@server.com",
"subject": "{{.installation.ID}} - {{.installation.Name}}"
}
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [NotificationOutput] | false | none | none |
» id | integer | false | none | Output identifier. |
» name | string | true | none | A friendly name for this output. |
» notification_output_executor_id | integer | true | none | References a valid output executor by id |
» notification_message_id | integer | true | none | References a message by id. Message must refer to a message within the same installation |
» installation_id | integer | false | none | The installation id this notification is placed in. |
» config | object | true | none | Key/value storage of all configuration data, may be empty. values is run through the golang templating engine. |
»» key1 | string | false | none | none |
»» key2 | string | false | none | none |
Create notification output
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/notification/{installation_id}/output \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/notification/{installation_id}/output
Creates a notification output. Golang templates are supported in config values
Body parameter
{
"id": 2,
"name": "Mail notification",
"notification_output_executor_id": 1,
"notification_message_id": 1,
"config": {
"recipients": "recipient1@server.com, recipient2@server.com",
"subject": "{{.installation.ID}} - {{.installation.Name}}"
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | NotificationOutput | true | none |
Example responses
200 Response
{
"id": 2,
"name": "Mail notification",
"notification_output_executor_id": 1,
"notification_message_id": 1,
"config": {
"recipients": "recipient1@server.com, recipient2@server.com",
"subject": "{{.installation.ID}} - {{.installation.Name}}"
}
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | NotificationOutput |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Get notification output
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/notification/{installation_id}/output/{output_id} \
-H 'Accept: application/json'
GET /api/v2/notification/{installation_id}/output/{output_id}
Returns a notification output of given id in given installation
Example responses
200 Response
{
"id": 2,
"name": "Mail notification",
"notification_output_executor_id": 1,
"notification_message_id": 1,
"config": {
"recipients": "recipient1@server.com, recipient2@server.com",
"subject": "{{.installation.ID}} - {{.installation.Name}}"
}
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | NotificationOutput |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Update notification output
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/notification/{installation_id}/output/{output_id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
PUT /api/v2/notification/{installation_id}/output/{output_id}
Updates a notification output
Body parameter
{
"id": 2,
"name": "Mail notification",
"notification_output_executor_id": 1,
"notification_message_id": 1,
"config": {
"recipients": "recipient1@server.com, recipient2@server.com",
"subject": "{{.installation.ID}} - {{.installation.Name}}"
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | NotificationOutput | true | none |
Example responses
200 Response
{
"id": 2,
"name": "Mail notification",
"notification_output_executor_id": 1,
"notification_message_id": 1,
"config": {
"recipients": "recipient1@server.com, recipient2@server.com",
"subject": "{{.installation.ID}} - {{.installation.Name}}"
}
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | NotificationOutput |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Delete notification output
Code samples
# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/notification/{installation_id}/output/{output_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
DELETE /api/v2/notification/{installation_id}/output/{output_id}
Deletes a notification output in given installation
Example responses
200 Response
{
"message": "Deleted"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Resource deleted | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
List notification output executors
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/notification/{installation_id}/executor \
-H 'Accept: application/json'
GET /api/v2/notification/{installation_id}/executor
Returns a list of available notification output executors for given installation
Example responses
200 Response
[
{
"type": "mail",
"name": "Mail",
"organization_id": 1,
"config": {
"from": "host@server.com",
"endpoint": "https://executor.host.tld"
}
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [NotificationOutputExecutor] | false | none | none |
» id | integer | false | none | Output identifier |
» type | string | true | none | Type of notifier |
» name | string | true | none | Name of notifier |
» organization_id | integer | true | none | The organization id of this notifier |
» config | object | true | none | Key/value storage of all configuration data. An endpoint key is required as it determines where to forward notification action |
»» key1 | string | false | none | none |
»» key2 | string | false | none | none |
Get notification output executor
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/notification/{installation_id}/executor/{executor_id} \
-H 'Accept: application/json'
GET /api/v2/notification/{installation_id}/executor/{executor_id}
Returns a notification output executor of given id
Example responses
200 Response
{
"type": "mail",
"name": "Mail",
"organization_id": 1,
"config": {
"from": "host@server.com",
"endpoint": "https://executor.host.tld"
}
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | NotificationOutputExecutor |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Send notifications
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/notification/{installation_id}/output/{output_id}/send \
-H 'Accept: application/json'
POST /api/v2/notification/{installation_id}/output/{output_id}/send
Trigger a notification output. If the POST data contains a JSON object it will be available in the templating and passed to the executor parameters.
Example responses
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
502 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | None |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
502 | Bad Gateway | Unexpected error | MessageResponse |
List notification executors (Admin)
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/admin/notification/executor \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/admin/notification/executor
Returns a list of available notification output executors that you can manage
Example responses
200 Response
[
{
"type": "mail",
"name": "Mail",
"organization_id": 1,
"config": {
"from": "host@server.com",
"endpoint": "https://executor.host.tld"
}
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [NotificationOutputExecutorAdmin] | false | none | none |
» id | integer | false | none | Output identifier |
» type | string | true | none | Type of notifier |
» name | string | true | none | Name of notifier |
» organization_id | integer | true | none | The organization id of this notifier |
» config | object | true | none | Key/value storage of all configuration data. An endpoint key is required as it determines where to forward notification action |
»» key1 | string | false | none | none |
»» key2 | string | false | none | none |
» secret | string | false | none | X-API-Key value when sending messages |
Create notification executors (Admin)
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/admin/notification/executor \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/admin/notification/executor
Creates a new notification output executor, available to installations belonging to the specified organization or sub-organizations in the tree.
Body parameter
{
"type": "mail",
"name": "Mail",
"organization_id": 1,
"config": {
"from": "host@server.com",
"endpoint": "https://executor.host.tld"
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | NotificationOutputExecutorAdmin | true | none |
Example responses
200 Response
[
{
"type": "mail",
"name": "Mail",
"organization_id": 1,
"config": {
"from": "host@server.com",
"endpoint": "https://executor.host.tld"
}
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [NotificationOutputExecutorAdmin] | false | none | none |
» id | integer | false | none | Output identifier |
» type | string | true | none | Type of notifier |
» name | string | true | none | Name of notifier |
» organization_id | integer | true | none | The organization id of this notifier |
» config | object | true | none | Key/value storage of all configuration data. An endpoint key is required as it determines where to forward notification action |
»» key1 | string | false | none | none |
»» key2 | string | false | none | none |
» secret | string | false | none | X-API-Key value when sending messages |
Get notification executor (Admin)
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/admin/notification/executor/{executor_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/admin/notification/executor/{executor_id}
Returns a notification output executor of given id
Example responses
200 Response
{
"type": "mail",
"name": "Mail",
"organization_id": 1,
"config": {
"from": "host@server.com",
"endpoint": "https://executor.host.tld"
}
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | NotificationOutputExecutorAdmin |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Update notification executor (Admin)
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/admin/notification/executor/{executor_id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
PUT /api/v2/admin/notification/executor/{executor_id}
Updates a notification output executor.
Body parameter
{
"type": "mail",
"name": "Mail",
"organization_id": 1,
"config": {
"from": "host@server.com",
"endpoint": "https://executor.host.tld"
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | NotificationOutputExecutorAdmin | true | none |
Example responses
200 Response
[
{
"type": "mail",
"name": "Mail",
"organization_id": 1,
"config": {
"from": "host@server.com",
"endpoint": "https://executor.host.tld"
}
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [NotificationOutputExecutorAdmin] | false | none | none |
» id | integer | false | none | Output identifier |
» type | string | true | none | Type of notifier |
» name | string | true | none | Name of notifier |
» organization_id | integer | true | none | The organization id of this notifier |
» config | object | true | none | Key/value storage of all configuration data. An endpoint key is required as it determines where to forward notification action |
»» key1 | string | false | none | none |
»» key2 | string | false | none | none |
» secret | string | false | none | X-API-Key value when sending messages |
Installation
Create Installation
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/installation \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/installation
Create installation and information regarding it
Body parameter
{
"name": "string",
"organization_id": 0,
"notes": "string",
"users": [
0
],
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | Installation | true | none |
Example responses
200 Response
{
"id": 0,
"name": "string",
"client_id": 0,
"created": 0,
"organization_id": 0,
"notes": "string",
"users": [
0
],
"meta": {
"key1": "string",
"key2": "string"
}
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | InstallationResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
List Installation
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/installation \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/installation
List of all installations that this user have access to.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
{metadata-key} | query | string | false | Key => value map to filter installation, wildcard supported in values. Can occur several times. |
Example responses
200 Response
[
{
"id": 0,
"name": "string",
"client_id": 0,
"created": 0,
"organization_id": 0,
"notes": "string",
"users": [
0
],
"meta": {
"key1": "string",
"key2": "string"
}
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [InstallationResponse] | false | none | none |
» id | integer | false | none | Installation identifier |
» name | string | true | none | Descriptive name of the installation |
» client_id | integer | false | none | identifier used on MQTT |
» created | integer | false | none | Unix-timestamp of creation |
» organization_id | integer | true | none | ID of the organization where this installation is placed |
» notes | string | true | none | none |
» users | [integer] | true | none | All user IDs associated with this installation |
» meta | object | false | none | Key => value storage of all meta-data, may be empty |
»» key1 | string | false | none | none |
»» key2 | string | false | none | none |
Get Installation
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/installation/{installation_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/installation/{installation_id}
Returns a single installation identified by installation_id
Example responses
200 Response
{
"id": 0,
"name": "string",
"client_id": 0,
"created": 0,
"organization_id": 0,
"notes": "string",
"users": [
0
],
"meta": {
"key1": "string",
"key2": "string"
}
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | InstallationResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Update Installation
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/installation/{installation_id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
PUT /api/v2/installation/{installation_id}
Update parameters for a installation to the provided data
Body parameter
{
"name": "string",
"organization_id": 0,
"notes": "string",
"users": [
0
],
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
silent | query | boolean | false | Suppress MQTT update notification |
body | body | Installation | true | none |
Example responses
200 Response
{
"id": 0,
"name": "string",
"client_id": 0,
"created": 0,
"organization_id": 0,
"notes": "string",
"users": [
0
],
"meta": {
"key1": "string",
"key2": "string"
}
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | InstallationResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Delete Installation
Code samples
# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/installation/{installation_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
DELETE /api/v2/installation/{installation_id}
Delete installation identified by installation_id
Example responses
200 Response
{
"message": "string"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Get Meta key
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/installation/{installation_id}/meta/{meta_key} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/installation/{installation_id}/meta/{meta_key}
Get the value and protected flag of a particular meta key.
Example responses
200 Response
{
"value": "Hello world",
"protected": false
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
404 Response
{
"message": "Not found"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MetaX |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
404 | Not Found | Not found | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Create Meta key
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/installation/{installation_id}/meta/{meta_key} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/installation/{installation_id}/meta/{meta_key}
Create a given meta_key with the provided value and protected flag.
Body parameter
{
"value": "Hello World",
"protected": false
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
meta_key | path | string | true | Meta key to create |
silent | query | boolean | false | Skip MQTT publish. Defaults to false . |
body | body | MetaX | true | Value of meta key |
Detailed descriptions
silent: Skip MQTT publish. Defaults to false
.
Don't publish an MQTT message indicating updated installation.
Setting this to true
will skip MQTT updated event.
Setting this to false
will send MQTT updated event.
Example responses
200 Response
{
"value": "Hello world",
"protected": false
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
404 Response
{
"message": "Not found"
}
409 Response
{
"message": "duplicate key"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MetaX |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
404 | Not Found | Not found | MessageResponse |
409 | Conflict | Duplicate key | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Update Meta key
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/installation/{installation_id}/meta/{meta_key} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
PUT /api/v2/installation/{installation_id}/meta/{meta_key}
Update a given meta_key with the provided value and protected flag.
Body parameter
{
"value": "Hello World",
"protected": false
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
meta_key | path | string | true | Meta key to create |
silent | query | boolean | false | Skip MQTT publish. Defaults to false . |
create_missing | query | boolean | false | Create the key if it does not exist. Defaults to false . |
body | body | MetaX | true | New value of meta key |
Detailed descriptions
silent: Skip MQTT publish. Defaults to false
.
Don't publish an MQTT message indicating updated installation.
Setting this to true
will skip MQTT updated event.
Setting this to false
will send MQTT updated event.
create_missing: Create the key if it does not exist. Defaults to false
.
Setting this to true
will create the key if it is missing.
Setting this to false
will return 404 if the key does not exist.
Example responses
200 Response
{
"value": "Hello",
"protected": false
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
404 Response
{
"message": "Not found"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MetaX |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
404 | Not Found | Not found | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Delete Meta key
Code samples
# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/installation/{installation_id}/meta/{meta_key} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
DELETE /api/v2/installation/{installation_id}/meta/{meta_key}
Delete the given meta key.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
silent | query | boolean | false | Skip MQTT publish. |
Detailed descriptions
silent: Skip MQTT publish.
Don't publish an MQTT message indicating updated installation.
Setting this to true
will create the key if it is missing.
Setting this to false
will return 404 if the key does not exist.
Example responses
200 Response
{
"message": "Deleted"
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
404 Response
{
"message": "Not found"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Resource deleted | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
404 | Not Found | Not found | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
MQTT
MQTT Publish
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/mqtt/publish/{installation_id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/mqtt/publish/{installation_id}
Send a message on the MQTT broker on the specified installation.
Body parameter
{
"topic": "obj/device/1/temperature",
"payload": {
"value": 22.1
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | MQTTPublish | true | none |
Example responses
200 Response
{
"message": "string"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
User registration
Register account
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/user/register \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST /api/v2/user/register
Register a new account
Body parameter
{
"email": "string",
"first_name": "string",
"last_name": "string",
"address": {
"address": "string",
"city": "string",
"country": "string",
"zip": "string"
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | UserRegistration | true | none |
Example responses
202 Response
{
"message": "Registered"
}
400 Response
{
"message": "'name' can not be empty"
}
403 Response
{
"message": "Disabled"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
202 | Accepted | Registered | MessageResponse |
400 | Bad Request | Something in the provided data is missing or malformed. | MessageResponse |
403 | Forbidden | Registration disabled | MessageResponse |
List registration policies
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/user/registration/policy/{policy_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/user/registration/policy/{policy_id}
List all current registration policies
Example responses
200 Response
[
{
"id": 0,
"email_pattern": "string",
"role_id": 0,
"parent_organization_id": 0,
"organization_id": 0
}
]
403 Response
{
"message": "Forbidden"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [UserRegistrationPolicy] | false | none | none |
» id | integer | true | none | Policy id |
» email_pattern | string | true | none | Wildcard pattern to match registration request emails with |
» role_id | integer | true | none | Role to give the new user |
» parent_organization_id | integer | false | none | If this field is set; create a new organization under parent organization for the new user |
» organization_id | integer | false | none | If parent_organization_id is not set, the new user will be put into this organization |
Delete registration policy
Code samples
# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/user/registration/policy/{policy_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
DELETE /api/v2/user/registration/policy/{policy_id}
Delete a registration policy
Example responses
200 Response
{
"message": "Deleted"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Resource deleted | MessageResponse |
Update registration policy
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/user/registration/policy/{policy_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
PUT /api/v2/user/registration/policy/{policy_id}
Update a registration policy
Example responses
200 Response
{
"id": 0,
"email_pattern": "string",
"role_id": 0,
"parent_organization_id": 0,
"organization_id": 0
}
400 Response
{
"message": "'name' can not be empty"
}
403 Response
{
"message": "Forbidden"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | UserRegistrationPolicy |
400 | Bad Request | Something in the provided data is missing or malformed. | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
Create registration policy
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/user/registration/policy \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/user/registration/policy
Create a new registration policy. A policy determines which organization and role a new registered user will end up.
Email patterns are wildcards, and the most specific matching policy will chosen when registering new users.
registering with admin@iotopen.se
will match admin@iotopen.se
over *@iotopen.se
- email_pattern: "*" organization_id: 2 role_id: 3
- email_pattern: "*@iotopen.se" organization_id: 1 role_id: 3
- email_pattern: "admin@iotopen.se" organization_id: 1 role_id: 1
With this policy configuration would a registration with
- admin@iotopen.se end up in organization 1 and role 1
- hello_world@iotopen.se end up in organization 1 and role 3
- eve@gmail.com end up in organization 2 and role 3
Registration policies can also say that the new user should be created with their own organization under a specified organization, like so:
- email_pattern: "*" parent_organization_id: 2 role_id: 2
- email_pattern: "*@iotopen.se" parent_organization_id: 1 role_id: 2
- email_pattern: "admin@iotopen.se" parent_organization_id: 1 role_id: 1
with this policy configuration would a registration with
- admin@iotopen.se end up in a new organization under organization 1 with role 1
- hello_world@iotopen.se end up in a new organization under organization 1 with role 2
- eve@gmail.com end up in a new organization under organization 2 and role 2
Body parameter
{
"id": 0,
"email_pattern": "string",
"role_id": 0,
"parent_organization_id": 0,
"organization_id": 0
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | UserRegistrationPolicy | true | none |
Example responses
200 Response
{
"id": 0,
"email_pattern": "string",
"role_id": 0,
"parent_organization_id": 0,
"organization_id": 0
}
403 Response
{
"message": "Forbidden"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | UserRegistrationPolicy |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
File
List files (installation)
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/file/installation/{installation_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/file/installation/{installation_id}
Returns a list of all files belonging to installation with installation_id
.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
mime | query | string | false | Filter the result on specified mime type, wildcards allowed |
Example responses
200 Response
[
{
"id": 0,
"hash": "string",
"name": "string",
"mime": "string",
"installation_id": 0,
"organization_id": 0,
"updated": 0,
"created": 0
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [File] | false | none | none |
» id | number | false | none | Identifier. |
» hash | string | false | none | The sha256 sum of the uploaded file. |
» name | string | false | none | The filename. |
» mime | string | false | none | Mime type of the file when uploaded. |
» installation_id | number | false | none | If the file is uploaded to an installation this is the installation ID. |
» organization_id | number | false | none | If the file is uploaded to an organization this is the organization ID. |
» updated | number | false | none | Unix timestamp for last updated time. |
» created | number | false | none | Unix timestamp for created time. |
Create File (installation)
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/file/installation/{installation_id} \
-H 'Content-Type: multipart/form-data' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/file/installation/{installation_id}
Create one or several new files on an installation.
Body parameter
filename:
- string
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» filename | body | [string] | true | Multipart file inclusion. Each item needs the Content-Type header to be set. |
Example responses
200 Response
[
{
"id": 0,
"hash": "string",
"name": "string",
"mime": "string",
"installation_id": 0,
"organization_id": 0,
"updated": 0,
"created": 0
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [File] | false | none | none |
» id | number | false | none | Identifier. |
» hash | string | false | none | The sha256 sum of the uploaded file. |
» name | string | false | none | The filename. |
» mime | string | false | none | Mime type of the file when uploaded. |
» installation_id | number | false | none | If the file is uploaded to an installation this is the installation ID. |
» organization_id | number | false | none | If the file is uploaded to an organization this is the organization ID. |
» updated | number | false | none | Unix timestamp for last updated time. |
» created | number | false | none | Unix timestamp for created time. |
Get File (installation)
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/file/installation/{installation_id}/{file_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/file/installation/{installation_id}/{file_id}
Returns a single file on an installation if it exists. Identified with file_id
.
Example responses
200 Response
{
"id": 0,
"hash": "string",
"name": "string",
"mime": "string",
"installation_id": 0,
"organization_id": 0,
"updated": 0,
"created": 0
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | File |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Update File (installation)
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/file/installation/{installation_id}/{file_id} \
-H 'Content-Type: multipart/form-data' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
PUT /api/v2/file/installation/{installation_id}/{file_id}
Update a file, the Content-Type must be the same. File with ID is updated in disk.
Body parameter
filename: string
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» filename | body | string(binary) | true | none |
Example responses
200 Response
{
"id": 0,
"hash": "string",
"name": "string",
"mime": "string",
"installation_id": 0,
"organization_id": 0,
"updated": 0,
"created": 0
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | File |
Delete File (installation)
Code samples
# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/file/installation/{installation_id}/{file_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
DELETE /api/v2/file/installation/{installation_id}/{file_id}
Remove a file belonging to an installation.
Example responses
200 Response
{
"message": "Deleted"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Resource deleted | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
List files (organization)
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/file/organization/{organization_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/file/organization/{organization_id}
Returns a list of all files belonging to organization with organization_id
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
mime | query | string | false | Filter the result on specified mime type, wildcards allowed |
Example responses
200 Response
[
{
"id": 0,
"hash": "string",
"name": "string",
"mime": "string",
"installation_id": 0,
"organization_id": 0,
"updated": 0,
"created": 0
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [File] | false | none | none |
» id | number | false | none | Identifier. |
» hash | string | false | none | The sha256 sum of the uploaded file. |
» name | string | false | none | The filename. |
» mime | string | false | none | Mime type of the file when uploaded. |
» installation_id | number | false | none | If the file is uploaded to an installation this is the installation ID. |
» organization_id | number | false | none | If the file is uploaded to an organization this is the organization ID. |
» updated | number | false | none | Unix timestamp for last updated time. |
» created | number | false | none | Unix timestamp for created time. |
Create File (organization)
Code samples
# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/file/organization/{organization_id} \
-H 'Content-Type: multipart/form-data' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
POST /api/v2/file/organization/{organization_id}
Create one or several new files on an organization.
Body parameter
filename:
- string
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» filename | body | [string] | true | Multipart file inclusion. Each item needs the Content-Type header to be set. |
Example responses
200 Response
[
{
"id": 0,
"hash": "string",
"name": "string",
"mime": "string",
"installation_id": 0,
"organization_id": 0,
"updated": 0,
"created": 0
}
]
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [File] | false | none | none |
» id | number | false | none | Identifier. |
» hash | string | false | none | The sha256 sum of the uploaded file. |
» name | string | false | none | The filename. |
» mime | string | false | none | Mime type of the file when uploaded. |
» installation_id | number | false | none | If the file is uploaded to an installation this is the installation ID. |
» organization_id | number | false | none | If the file is uploaded to an organization this is the organization ID. |
» updated | number | false | none | Unix timestamp for last updated time. |
» created | number | false | none | Unix timestamp for created time. |
Get File (organization)
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/file/organization/{organization_id}/{file_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/file/organization/{organization_id}/{file_id}
Returns a single file on an organization if it exists. Identified with file_id
.
Example responses
200 Response
{
"id": 0,
"hash": "string",
"name": "string",
"mime": "string",
"installation_id": 0,
"organization_id": 0,
"updated": 0,
"created": 0
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | File |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Update File (organization)
Code samples
# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/file/organization/{organization_id}/{file_id} \
-H 'Content-Type: multipart/form-data' \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
PUT /api/v2/file/organization/{organization_id}/{file_id}
Update a file, the Content-Type must be the same. File with ID is updated in disk.
Body parameter
filename: string
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» filename | body | string(binary) | true | none |
Example responses
200 Response
{
"id": 0,
"hash": "string",
"name": "string",
"mime": "string",
"installation_id": 0,
"organization_id": 0,
"updated": 0,
"created": 0
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | File |
Delete File (organization)
Code samples
# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/file/organization/{organization_id}/{file_id} \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
DELETE /api/v2/file/organization/{organization_id}/{file_id}
Remove a file belonging to an organization.
Example responses
200 Response
{
"message": "Deleted"
}
401 Response
{
"message": "Unauthorized"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Resource deleted | MessageResponse |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Download File
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/file/download/{hash} \
-H 'Accept: application/json'
GET /api/v2/file/download/{hash}
Download a file. Accepted format can be specified with the Accept header.
Example responses
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | None |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Trace
List trace
Code samples
# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/trace \
-H 'Accept: application/json' \
-H 'X-API-Key: API_KEY'
GET /api/v2/trace
Logs for tracing usage and modifications of objects in the API.
The object_id
is set to 0 for all GET requests where tha path
contained no id, such as listing User Registration Policy and listing of Roles.
Possible object-types is:
Type | Description |
---|---|
installation | Installation objects |
gateway | Installations identified by ClientID |
organization | Organization objects |
user | User objects |
device | DeviceX objects |
function | FunctionX objects |
schedule | Schedule objects |
notification_output | Notification output objects |
notification_message | Notification message objects |
output_executor | Output executor objects |
edge_app | Edge app objects |
edge_app_instance | Edge app instance objects |
file | File objects |
role | Role objects |
gateway_registration_policy | Gateway registration policy objects |
user_registration_policy | User registration policy objects |
mqtt | MQTT Send API usage |
trace | Trace log access, object_id is always 0 |
Note: Either object_type
and object_id
or only id
must be
used to filter the data in the request.
Possible actions are:
Action | Description |
---|---|
create | Object has been created |
delete | Object has been deleted |
update | Object has been updated |
view | Object has been fetched |
failed | Notification executor failed |
execute | Notification executor is run |
auth | Successful login |
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
from | query | integer | false | Unix time to fetch times from, defaults to now - 24h |
to | query | integer | false | Maximum unix time for log entry, defaults to now |
limit | query | integer | false | Maximum number of results, default is 10 000 . |
offset | query | integer | false | Offset the result by this many entries, defaults to 0 |
order | query | string | false | Sort order, either desc (default) or asc |
object_type | query | string | false | Type of object to look for, see list above |
object_id | query | integer | false | ID of the object to search for |
id | query | string | false | If object_type and object_id or user_id is not used, |
action | query | string | false | Filter for action types, see further down. Can be a |
Detailed descriptions
id: If object_type
and object_id
or user_id
is not used,
fetch all logs for a specific requests id.
action: Filter for action types, see further down. Can be a comma-separated list.
Example responses
200 Response
{
"total": 0,
"last": 0,
"count": 0,
"data": [
{
"id": "string",
"path": "string",
"method": "string",
"timestamp": 0,
"user_id": 0,
"action": "string",
"object_type": "string",
"object_id": 0,
"description": "string"
}
]
}
401 Response
{
"message": "Unauthorized"
}
403 Response
{
"message": "Forbidden"
}
500 Response
{
"message": "Internal Server Error"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | TraceLog |
401 | Unauthorized | Token is invalid or missing | MessageResponse |
403 | Forbidden | Not allowed to access that ID. | MessageResponse |
500 | Internal Server Error | Unexpected error | MessageResponse |
Schemas
Address
{
"address": "string",
"city": "string",
"country": "string",
"zip": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
address | string | true | none | Street address |
city | string | true | none | City name |
country | string | true | none | Country |
zip | string | true | none | Zip code of the address |
EdgeApp
{
"id": 0,
"name": "string",
"category": "string",
"tags": [
"string"
],
"short_description": "string",
"description": "string",
"publisher": {
"name": "string",
"id": 0
},
"official": true,
"public": true,
"source_url": "string",
"created": 0,
"updated": 0
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | number | false | none | Identifier. |
name | string | true | none | Name of the app. |
category | string | true | none | The category that the app is placed in. |
tags | [string] | true | none | All tags set for this app. |
short_description | string | true | none | A shorter description for the app |
description | string | true | none | A longer and more detailed description. Markdown format is allowed to do rich text formatting. |
publisher | object | true | none | Information about the organization that published the app. |
» name | string | false | none | Name of the organization publishing the app |
» id | number | true | none | Identifier of the organization |
official | boolean | false | none | Set to true if this is an official app. |
public | boolean | true | none | If tha app is made for all users or just the provided publisher. |
source_url | string | false | none | Where the source code is available online. |
created | number | false | none | Unix-timestamp of creation |
updated | number | false | none | Unix-timestamp of last modified. |
EdgeAppPublisher
{
"id": 0,
"name": "string",
"apps": [
{
"id": 0,
"name": "string",
"category": "string",
"tags": [
"string"
],
"short_description": "string",
"description": "string",
"publisher": {
"name": "string",
"id": 0
},
"official": true,
"public": true,
"source_url": "string",
"created": 0,
"updated": 0
}
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | number | false | none | Identifier of the publisher organization |
name | string | false | none | Name of the publisher organization |
apps | [EdgeApp] | false | none | none |
EdgeAppConfig
{
"id": 0,
"app_id": 0,
"installation_id": 0,
"version": "string",
"config": {},
"name": "string",
"created": 0,
"updated": 0
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | number | false | none | Identifier. |
app_id | number | true | none | Identifier of the app being configured. |
installation_id | number | true | none | Identifier of the installation being configured. |
version | string | true | none | Version number for the app being configured. |
config | object | true | none | All config parameters set by the user. |
name | string | true | none | User defined name for this instance of the app. |
created | number | false | none | Unix-timestamp of creation |
updated | number | false | none | Unix-timestamp of last modified. |
EdgeAppVersion
{
"name": "string",
"hash": "string",
"timestamp": 0
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
name | string | false | none | Visible name for the version |
hash | string | true | none | Hash to set the version name for |
timestamp | number | false | none | The unix-timestamp for the upload of the version |
File
{
"id": 0,
"hash": "string",
"name": "string",
"mime": "string",
"installation_id": 0,
"organization_id": 0,
"updated": 0,
"created": 0
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | number | false | none | Identifier. |
hash | string | false | none | The sha256 sum of the uploaded file. |
name | string | false | none | The filename. |
mime | string | false | none | Mime type of the file when uploaded. |
installation_id | number | false | none | If the file is uploaded to an installation this is the installation ID. |
organization_id | number | false | none | If the file is uploaded to an organization this is the organization ID. |
updated | number | false | none | Unix timestamp for last updated time. |
created | number | false | none | Unix timestamp for created time. |
GatewayInformation
{
"client_id": 0,
"installation_id": 0,
"api": "string",
"aam": "string",
"mqtt_broker": "string",
"mqtt_username": "string",
"mqtt_password": "string",
"mqtt_client_id": "string",
"timezone": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
client_id | number | false | none | Client ID for the MQTT topic |
installation_id | number | false | none | Identifyer |
api | string | false | none | The base HTTP URL for API access. |
aam | string | false | none | Legacy, same as api |
mqtt_broker | string | false | none | Broker url in the format server.tld:port |
mqtt_username | string | false | none | Username for MQTT connection |
mqtt_password | string | false | none | Password for MQTT connection and API access |
mqtt_client_id | string | false | none | Client ID to use on the MQTT connection |
timezone | string | false | none | The default timezone that the server have |
GatewayRegistrationPolicy
{
"allow_unregistered": true,
"default_organization_id": 10
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
allow_unregistered | boolean | true | none | whether to allow new previously unregistered gateways to register |
default_organization_id | number | true | none | the organization id which new gateways are assigned to |
Installation
{
"name": "string",
"organization_id": 0,
"notes": "string",
"users": [
0
],
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
name | string | true | none | Descriptive name of the installation |
organization_id | integer | true | none | ID of the organization where this installation is placed |
notes | string | true | none | none |
users | [integer] | true | none | User IDs associated with this installation |
meta | object | false | none | Key => value storage of all meta-data, may be empty |
» key1 | string | false | none | none |
» key2 | string | false | none | none |
protected_meta | object | false | none | Key => value storage of meta-data that can be restricted access to by permissions. |
» key1 | string | false | none | none |
» key2 | string | false | none | none |
InstallationInfo
{
"capabilities": [],
"client_id": 1,
"id": 1,
"name": "string",
"organization_id": 0,
"assigned": true
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
capabilities | array | false | none | Capabilities of this installation |
client_id | integer | false | none | ClientID identifier used on MQTT |
id | integer | false | none | Identifier used in API:s |
name | string | false | none | none |
organization_id | number | false | none | ID of the organization where this installation is placed. |
assigned | boolean | false | none | Indicates if installation is assigned to the current user account. |
InstallationResponse
{
"id": 0,
"name": "string",
"client_id": 0,
"created": 0,
"organization_id": 0,
"notes": "string",
"users": [
0
],
"meta": {
"key1": "string",
"key2": "string"
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | integer | false | none | Installation identifier |
name | string | true | none | Descriptive name of the installation |
client_id | integer | false | none | identifier used on MQTT |
created | integer | false | none | Unix-timestamp of creation |
organization_id | integer | true | none | ID of the organization where this installation is placed |
notes | string | true | none | none |
users | [integer] | true | none | All user IDs associated with this installation |
meta | object | false | none | Key => value storage of all meta-data, may be empty |
» key1 | string | false | none | none |
» key2 | string | false | none | none |
LogEntry
{
"id": 0,
"function_id": "string",
"function_type": "string",
"log_item_type": "string",
"name": "string",
"unit": "string",
"icon": "string",
"alarm_type": "string",
"value": 0,
"timestamp": 0,
"value_id": "string",
"message": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | integer | false | none | Unique identifier |
function_id | string | false | none | Identifier of function |
function_type | string | false | none | Type of function |
log_item_type | string | false | none | If the reference function is a FunctionX or legacy Function. |
name | string | false | none | Name of the function |
unit | string | false | none | DEPRECATED |
icon | string | false | none | Icon from the function |
alarm_type | string | false | none | DEPRECATED |
value | number | false | none | The logged value |
timestamp | number | false | none | Time of event using millisecond precision with decimals on Unix timestamp. |
value_id | string | false | none | DEPRECATED |
message | string | false | none | The msg field of the MQTT message if present |
MessageResponse
{
"message": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
message | string | false | none | none |
ModelXNoID
{
"installation_id": 1,
"type": "string",
"meta": {
"key1": "string",
"key2": "string"
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
installation_id | integer | true | none | Installations ID |
type | string | true | none | Type identifier used to look for meta-data |
meta | object | true | none | Key => value storage of all meta-data, may be empty |
» key1 | string | false | none | none |
» key2 | string | false | none | none |
MetaX
{
"value": "Hello World",
"protected": false
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
value | string | true | none | none |
protected | boolean | true | none | none |
ModelX
{
"id": 1,
"installation_id": 1,
"type": "string",
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | integer | false | none | Identifier |
installation_id | integer | true | none | Installations ID |
type | string | true | none | Type identifier used to look for meta-data |
meta | object | true | none | Key => value storage of all meta-data, may be empty |
» key1 | string | false | none | none |
» key2 | string | false | none | none |
protected_meta | object | false | none | Key => value storage of meta-data that can be restricted access to by permissions. |
» key1 | string | false | none | none |
» key2 | string | false | none | none |
MQTTPublish
{
"topic": "obj/device/1/temperature",
"payload": {
"value": 22.1
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
topic | string | true | none | The topic to publish on for the installation |
qos | integer | false | none | QoS of the MQTT message, see MQTT Specification |
retained | boolean | false | none | Retain flag of the MQTT message, see MQTT Specification |
payload | object | true | none | The mqtt payload object in JSON format |
NotificationMessage
{
"name": "My message",
"text": "{{.installation.Name}} says: {{.payload.message}}"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | integer | true | none | Message identifier. |
name | string | true | none | A friendly name for this message. |
text | string | true | none | Body of message. Golang templates are supported. |
NotificationOutput
{
"id": 2,
"name": "Mail notification",
"notification_output_executor_id": 1,
"notification_message_id": 1,
"config": {
"recipients": "recipient1@server.com, recipient2@server.com",
"subject": "{{.installation.ID}} - {{.installation.Name}}"
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | integer | false | none | Output identifier. |
name | string | true | none | A friendly name for this output. |
notification_output_executor_id | integer | true | none | References a valid output executor by id |
notification_message_id | integer | true | none | References a message by id. Message must refer to a message within the same installation |
installation_id | integer | false | none | The installation id this notification is placed in. |
config | object | true | none | Key/value storage of all configuration data, may be empty. values is run through the golang templating engine. |
» key1 | string | false | none | none |
» key2 | string | false | none | none |
NotificationOutputExecutor
{
"type": "mail",
"name": "Mail",
"organization_id": 1,
"config": {
"from": "host@server.com",
"endpoint": "https://executor.host.tld"
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | integer | false | none | Output identifier |
type | string | true | none | Type of notifier |
name | string | true | none | Name of notifier |
organization_id | integer | true | none | The organization id of this notifier |
config | object | true | none | Key/value storage of all configuration data. An endpoint key is required as it determines where to forward notification action |
» key1 | string | false | none | none |
» key2 | string | false | none | none |
NotificationOutputExecutorAdmin
{
"type": "mail",
"name": "Mail",
"organization_id": 1,
"config": {
"from": "host@server.com",
"endpoint": "https://executor.host.tld"
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | integer | false | none | Output identifier |
type | string | true | none | Type of notifier |
name | string | true | none | Name of notifier |
organization_id | integer | true | none | The organization id of this notifier |
config | object | true | none | Key/value storage of all configuration data. An endpoint key is required as it determines where to forward notification action |
» key1 | string | false | none | none |
» key2 | string | false | none | none |
secret | string | false | none | X-API-Key value when sending messages |
Organization
{
"id": 0,
"name": "string",
"address": {
"address": "string",
"city": "string",
"country": "string",
"zip": "string"
},
"email": "string",
"phone": "string",
"force_sms_login": true,
"parent": 0,
"children": [
{
"name": 0,
"id": 0
}
],
"notes": "string",
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
},
"password_valid_days": 0
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | number | false | none | Identifier. |
name | string | true | none | Name |
address | Address | true | none | none |
string | false | none | Contact email for the organization. | |
phone | string | false | none | Contact phone number for the organization. |
force_sms_login | boolean | true | none | Force all users belonging to this organization to use SMS-Login. |
parent | number | true | none | ID of the parent organization, will be set to 0 if this is the root of what the current authenticated account can view. |
children | [object] | false | none | A list of all direct child organizations with name and ID. |
» name | number | false | none | Name of the child organization. |
» id | number | false | none | ID of the child organization. |
notes | string | false | none | Free text notes for organization |
meta | object | false | none | Key => value storage of all meta-data, may be empty |
» key1 | string | false | none | none |
» key2 | string | false | none | none |
protected_meta | object | false | none | Key => value storage of meta-data that can be restricted access to by permissions. |
» key1 | string | false | none | none |
» key2 | string | false | none | none |
password_valid_days | number | false | none | Force user to change their password this many days since last password change. |
OrganizationSimplified
{
"id": 0,
"name": "string",
"parent": 0
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | number | false | none | Identifier. |
name | string | false | none | Name |
parent | number | false | none | ID of the parent organization, will be set to 0 if this is the root of what the current authenticated account can view. |
Resource
{
"content_id": "string",
"formats": {
"wav": "0d00f828a9770839f382e88bac751b4c"
},
"language": "string",
"mime": "string",
"name": "string",
"uuid": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
content_id | string | false | none | Identifier for object in all languages |
formats | object | false | none | Formats already transcoded for this resource and their MD5-sum |
» {format} | string | false | none | The MD5-sum of this resource in that format |
language | string | false | none | Language code that this resource is in, default 'en' |
mime | string | false | none | MIME type of the resource |
name | string | false | none | Name of the resource translated to locale |
uuid | string | false | none | Unique identifier for this resource |
Role
{
"id": 1,
"name": "string",
"permissions": {},
"priority": 0
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | integer | false | none | Role identifier. |
name | string | true | none | Descriptive name of the role. |
permissions | object | true | none | Associative map of permission to allowed (true/false). |
priority | number | true | none | Limiting access for role assignment. |
Schedule
{
"active": true,
"created_at": 0,
"day_of_month": "string",
"day_of_week": "string",
"month": "string",
"hour": "string",
"id": 0,
"installation_id": 0,
"minute": "string",
"topic": "string",
"updated_at": "string",
"value": 0,
"executor": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
active | boolean | true | none | If the schedule is active or not |
created_at | integer | false | none | Created date as UNIX-timestamp |
day_of_month | string | false | none | Comma separated list of days in a month where schedule is run. Indexed by 0, '*' for all days |
day_of_week | string | false | none | Comma separated list of weekdays where schedule is run. Indexed by 0 (sunday is both 0 and 7), '*' for all days |
month | string | false | none | Comma separated list of months where the schedule is run. Indexed by 0, '*' fo all months. |
hour | string | false | none | Hour of the day in 24-hour format or '*' for every hour |
id | number | false | none | Identifier |
installation_id | number | true | none | Installation id for the schedule |
minute | string | false | none | Minute of the hour or '*' for every minute |
topic | string | true | none | The topic to publish value on |
updated_at | string | false | none | Updated date as UNIX-timestamp |
value | number | true | none | Value to set on topic when schedule is run |
executor | string | false | none | Executor that is expected to run the schedule. Defaults to "gateway". |
Status
{
"client_id": 0,
"installation_id": 0,
"timestamp": 0,
"value": 0,
"msg": "string",
"topic": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
client_id | number | false | none | Client-ID used on MQTT |
installation_id | number | false | none | Installation-ID for the Client-ID in topic |
timestamp | number | false | none | Last values unix timestamp. With decimals for milliseconds. |
value | number | false | none | Last value |
msg | string | false | none | Msg field from MQTT on this value |
topic | string | false | none | Topic where value was reported |
TraceLog
{
"total": 0,
"last": 0,
"count": 0,
"data": [
{
"id": "string",
"path": "string",
"method": "string",
"timestamp": 0,
"user_id": 0,
"action": "string",
"object_type": "string",
"object_id": 0,
"description": "string"
}
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
total | number | false | none | Total number of entries with this set of parameters |
last | number | false | none | Timestamp of the last entry |
count | number | false | none | Count of entries in this response |
data | [object] | false | none | none |
» id | string | false | none | Unique identifier of the request |
» path | string | false | none | HTTP Path used in the request |
» method | string | false | none | HTTP Method used in the request |
» timestamp | number | false | none | Unix timestamp of when the request was completed |
» user_id | number | false | none | User-ID of the user doing the request |
» action | string | false | none | What action was logged, either create/delete/execute/failed/update/view/auth |
» object_type | string | false | none | What type of object the 'object_id' represents. |
» object_id | number | false | none | ID of the object |
» description | string | false | none | Short textual description of what was done |
User
{
"id": 0,
"email": "string",
"first_name": "string",
"last_name": "string",
"role": 0,
"sms_login": true,
"mobile": "string",
"note": "string",
"assigned_installations": [],
"organisations": [
0
],
"address": {
"address": "string",
"city": "string",
"country": "string",
"zip": "string"
},
"password": "string",
"meta": {
"key1": "string",
"key2": "string"
},
"protected_meta": {
"key1": "string",
"key2": "string"
},
"expire_at": 0
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | number | false | none | Identifier |
string | true | none | Email address | |
first_name | string | true | none | First name |
last_name | string | true | none | Last name |
role | integer | true | none | ID of Role applied to the user, see permissions and roles |
sms_login | boolean | false | none | Set to true forces this user to login in with 2FA using SMS |
mobile | string | false | none | Mobile phone number for this user |
note | string | false | none | A free text field for notes about this user |
assigned_installations | array | false | none | IDs of assigned installations, only available when fetching users |
organisations | [number] | true | none | IDs of organisations that this user belongs to |
address | Address | true | none | none |
password | string | false | none | User password, is only valid when creating new users or updating the authenticated user. |
meta | object | false | none | Key => value storage of all meta-data, may be empty |
» key1 | string | false | none | none |
» key2 | string | false | none | none |
protected_meta | object | false | none | Key => value storage of meta-data that can be restricted access to by permissions. |
» key1 | string | false | none | none |
» key2 | string | false | none | none |
expire_at | number | false | none | Expire user account at specific date/time. Defaults to 0 (no expiry).An expired account can't log in and are prevented from doing any API requests. The value 0 means no expiry and a negative expiry (-1 ) means expireimmediately. A positive value is a unix timestamp for when the account is supposed to be expired. A special permission is needed to modify the account expiry for accounts. |
UserRegistration
{
"email": "string",
"first_name": "string",
"last_name": "string",
"address": {
"address": "string",
"city": "string",
"country": "string",
"zip": "string"
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
string | true | none | Email of new user | |
first_name | string | true | none | Users first name |
last_name | string | true | none | Users last name |
address | Address | true | none | none |
UserRegistrationPolicy
{
"id": 0,
"email_pattern": "string",
"role_id": 0,
"parent_organization_id": 0,
"organization_id": 0
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | integer | true | none | Policy id |
email_pattern | string | true | none | Wildcard pattern to match registration request emails with |
role_id | integer | true | none | Role to give the new user |
parent_organization_id | integer | false | none | If this field is set; create a new organization under parent organization for the new user |
organization_id | integer | false | none | If parent_organization_id is not set, the new user will be put into this organization |
Token
{
"id": 13,
"type": "user_created",
"expires": 1678193578,
"session_timeout": 0,
"created": 1678193500,
"creator_agent": "Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405",
"name": "List Installation Key",
"last_used": 0,
"current": false,
"token": "abcdefghijklmnopqrstuvwxyz",
"accessed": [
{
"ip": "127.0.0.1",
"agent": "Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405",
"last_accessed": 0
}
],
"permissions": [
"installation/list/all"
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | Object | false | none | none |
id | number | false | none | token id |
type | string | false | none | token type (eg: user_created) |
expires | number | false | none | Expiration time for this token |
session_timeout | number | false | none | How long after last use this token will expire, 0 means expire will not be changed |
created | number | false | none | when the token was created |
creator_agent | string | false | none | User-Agent of the application that created the token |
name | string | false | none | User friendly name |
last_used | number | false | none | when the token was last used |
current | boolean | false | none | Indicates if this is the token used for the api call |
token | string | false | none | Generated token (only available when creating a new token) |
accessed | [object] | false | none | none |
» ip | string | false | none | ip address of host that used the token |
» agent | string | false | none | User-Agent of the client that used the token |
» last_accessed | number | false | none | Last time when this host used this token |
permissions | [string] | false | none | list of permissions valid for this token (cannot overreach the users own permissions) |
CreateToken
{
"expires": 1678193578,
"session_timeout": 0,
"name": "List Installation Key",
"permissions": [
"installation/list/all"
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | Object | false | none | none |
expires | number | false | none | Unix timestamp when token should expire, 0 means never |
session_timeout | number | false | none | How long after last use this token will expire, 0 means expire will not be changed |
name | string | false | none | Name of token |
permissions | [string] | false | none | list of permissions valid for this token (cannot overreach the users own permissions) |