{ "opencollection": "1.0.0", "info": { "name": "ThingsBoard Admin admin-controller telemetry-controller API", "version": "4.3.0.3DEMO" }, "items": [ { "info": { "name": "telemetry-controller", "type": "folder" }, "items": [ { "info": { "name": "Save Entity Attributes (saveEntityAttributesV1)", "type": "http" }, "http": { "method": "POST", "url": "https://demo.thingsboard.io/api/plugins/telemetry/:entityType/:entityId/:scope", "params": [ { "name": "entityType", "value": "", "type": "path", "description": "A string value representing the entity type. For example, 'DEVICE'" }, { "name": "entityId", "value": "", "type": "path", "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'" }, { "name": "scope", "value": "", "type": "path", "description": "A string value representing the attributes scope. For example, 'SERVER_SCOPE'." } ], "body": { "type": "json", "data": "{}" } }, "docs": "Creates or updates the entity attributes based on Entity Id and the specified attribute scope. List of possible attribute scopes depends on the entity type: \n\n * SERVER_SCOPE - supported for all entity types;\n * SHARED_SCOPE - supported for devices.\n\nThe request payload is a JSON object with key-value format of attributes to create or update. For example:\n\n```json\n{\n \"stringKey\":\"value1\", \n \"booleanKey\":true, \n \"doubleKey\":42.0, \n \"longKey\":73, \n \"jsonKey\": {\n \"someNumber\": 42,\n \"someArra" }, { "info": { "name": "Delete Entity Attributes (deleteEntityAttributes)", "type": "http" }, "http": { "method": "DELETE", "url": "https://demo.thingsboard.io/api/plugins/telemetry/:entityType/:entityId/:scope", "params": [ { "name": "entityType", "value": "", "type": "path", "description": "A string value representing the entity type. For example, 'DEVICE'" }, { "name": "entityId", "value": "", "type": "path", "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'" }, { "name": "scope", "value": "", "type": "path", "description": "A string value representing the attributes scope. For example, 'SERVER_SCOPE'." }, { "name": "keys", "value": "", "type": "query", "description": "A string value representing the comma-separated list of attributes keys. For example, 'active,inactivityAlarmTime'. If attribute keys contain comma, duplicate 'key' parameter for each key, for example '?key=my,key&key=my,second,key" }, { "name": "params", "value": "", "type": "query" } ] }, "docs": "Delete entity attributes using provided Entity Id, scope and a list of keys. Referencing a non-existing entity Id or invalid entity type will cause an error. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority." }, { "info": { "name": "Save or Update Time Series Data (saveEntityTelemetry)", "type": "http" }, "http": { "method": "POST", "url": "https://demo.thingsboard.io/api/plugins/telemetry/:entityType/:entityId/timeseries/:scope", "params": [ { "name": "entityType", "value": "", "type": "path", "description": "A string value representing the entity type. For example, 'DEVICE'" }, { "name": "entityId", "value": "", "type": "path", "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'" }, { "name": "scope", "value": "", "type": "path", "description": "Value is deprecated, reserved for backward compatibility and not used in the API call implementation. Specify any scope for compatibility" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Creates or updates the entity time series data based on the Entity Id and request payload.The request payload is a JSON document with three possible formats:\n\nSimple format without timestamp. In such a case, current server time will be used: \n\n```json\n{\"temperature\": 26}\n```\n\n Single JSON object with timestamp: \n\n```json\n{\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}}\n```\n\n JSON array with timestamps: \n\n```json\n[{\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}}, {\"t" }, { "info": { "name": "Save or Update Time Series Data with TTL (saveEntityTelemetryWithTTL)", "type": "http" }, "http": { "method": "POST", "url": "https://demo.thingsboard.io/api/plugins/telemetry/:entityType/:entityId/timeseries/:scope/:ttl", "params": [ { "name": "entityType", "value": "", "type": "path", "description": "A string value representing the entity type. For example, 'DEVICE'" }, { "name": "entityId", "value": "", "type": "path", "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'" }, { "name": "scope", "value": "", "type": "path", "description": "Value is deprecated, reserved for backward compatibility and not used in the API call implementation. Specify any scope for compatibility" }, { "name": "ttl", "value": "", "type": "path", "description": "A long value representing TTL (Time to Live) parameter." } ], "body": { "type": "json", "data": "{}" } }, "docs": "Creates or updates the entity time series data based on the Entity Id and request payload.The request payload is a JSON document with three possible formats:\n\nSimple format without timestamp. In such a case, current server time will be used: \n\n```json\n{\"temperature\": 26}\n```\n\n Single JSON object with timestamp: \n\n```json\n{\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}}\n```\n\n JSON array with timestamps: \n\n```json\n[{\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}}, {\"t" }, { "info": { "name": "Save Entity Attributes (saveEntityAttributesV2)", "type": "http" }, "http": { "method": "POST", "url": "https://demo.thingsboard.io/api/plugins/telemetry/:entityType/:entityId/attributes/:scope", "params": [ { "name": "entityType", "value": "", "type": "path", "description": "A string value representing the entity type. For example, 'DEVICE'" }, { "name": "entityId", "value": "", "type": "path", "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'" }, { "name": "scope", "value": "", "type": "path", "description": "A string value representing the attributes scope. For example, 'SERVER_SCOPE'." } ], "body": { "type": "json", "data": "{}" } }, "docs": "Creates or updates the entity attributes based on Entity Id and the specified attribute scope. List of possible attribute scopes depends on the entity type: \n\n * SERVER_SCOPE - supported for all entity types;\n * SHARED_SCOPE - supported for devices.\n\nThe request payload is a JSON object with key-value format of attributes to create or update. For example:\n\n```json\n{\n \"stringKey\":\"value1\", \n \"booleanKey\":true, \n \"doubleKey\":42.0, \n \"longKey\":73, \n \"jsonKey\": {\n \"someNumber\": 42,\n \"someArra" }, { "info": { "name": "Save Device Attributes (saveDeviceAttributes)", "type": "http" }, "http": { "method": "POST", "url": "https://demo.thingsboard.io/api/plugins/telemetry/:deviceId/:scope", "params": [ { "name": "deviceId", "value": "", "type": "path", "description": "A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'" }, { "name": "scope", "value": "", "type": "path", "description": "A string value representing the attributes scope. For example, 'SERVER_SCOPE'." } ], "body": { "type": "json", "data": "{}" } }, "docs": "Creates or updates the device attributes based on device id and specified attribute scope. The request payload is a JSON object with key-value format of attributes to create or update. For example:\n\n```json\n{\n \"stringKey\":\"value1\", \n \"booleanKey\":true, \n \"doubleKey\":42.0, \n \"longKey\":73, \n \"jsonKey\": {\n \"someNumber\": 42,\n \"someArray\": [1,2,3],\n \"someNestedObject\": {\"key\": \"value\"}\n }\n}\n```\n\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority." }, { "info": { "name": "Delete Device Attributes (deleteDeviceAttributes)", "type": "http" }, "http": { "method": "DELETE", "url": "https://demo.thingsboard.io/api/plugins/telemetry/:deviceId/:scope", "params": [ { "name": "deviceId", "value": "", "type": "path", "description": "A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'" }, { "name": "scope", "value": "", "type": "path", "description": "A string value representing the attributes scope. For example, 'SERVER_SCOPE'." }, { "name": "keys", "value": "", "type": "query", "description": "A string value representing the comma-separated list of attributes keys. For example, 'active,inactivityAlarmTime'. If attribute keys contain comma, duplicate 'key' parameter for each key, for example '?key=my,key&key=my,second,key" }, { "name": "params", "value": "", "type": "query" } ] }, "docs": "Delete device attributes using provided Device Id, scope and a list of keys. Referencing a non-existing Device Id will cause an error\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority." }, { "info": { "name": "Get Time Series Data (getTimeseries)", "type": "http" }, "http": { "method": "GET", "url": "https://demo.thingsboard.io/api/plugins/telemetry/:entityType/:entityId/values/timeseries", "params": [ { "name": "entityType", "value": "", "type": "path", "description": "A string value representing the entity type. For example, 'DEVICE'" }, { "name": "entityId", "value": "", "type": "path", "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'" }, { "name": "keys", "value": "", "type": "query", "description": "A string value representing the comma-separated list of telemetry keys. If keys are not selected, the result will return all latest time series. For example, 'temperature,humidity'. If telemetry keys contain comma, duplicate 'key' parameter for each key, for example '?key=my,key&key=my,second,key" }, { "name": "useStrictDataTypes", "value": "", "type": "query", "description": "Enables/disables conversion of telemetry values to strings. Conversion is enabled by default. Set parameter to 'true' in order to disable the conversion." }, { "name": "params", "value": "", "type": "query" }, { "name": "startTs", "value": "", "type": "query", "description": "A long value representing the start timestamp of the time range in milliseconds, UTC." }, { "name": "endTs", "value": "", "type": "query", "description": "A long value representing the end timestamp of the time range in milliseconds, UTC." }, { "name": "intervalType", "value": "", "type": "query", "description": "A string value representing the type fo the interval." }, { "name": "interval", "value": "", "type": "query", "description": "A long value representing the aggregation interval range in milliseconds." }, { "name": "timeZone", "value": "", "type": "query", "description": "A string value representing the timezone that will be used to calculate exact timestamps for 'WEEK', 'WEEK_ISO', 'MONTH' and 'QUARTER' interval types." }, { "name": "limit", "value": "", "type": "query", "description": "An integer value that represents a max number of time series data points to fetch. This parameter is used only in the case if 'agg' parameter is set to 'NONE'." }, { "name": "agg", "value": "", "type": "query", "description": "A string value representing the aggregation function. If the interval is not specified, 'agg' parameter will use 'NONE' value." }, { "name": "orderBy", "value": "", "type": "query", "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)" } ] }, "docs": "Returns a range of time series values for specified entity. Returns not aggregated data by default. Use aggregation function ('agg') and aggregation interval ('interval') to enable aggregation of the results on the database / server side. The aggregation is generally more efficient then fetching all records. \n\n```json\n{\n \"temperature\": [\n {\n \"value\": 36.7,\n \"ts\": 1609459200000\n },\n {\n \"value\": 36.6,\n \"ts\": 1609459201000\n }\n ]\n}\n```\n\nReferencing a non-existing en" }, { "info": { "name": "Get Attributes (getAttributes)", "type": "http" }, "http": { "method": "GET", "url": "https://demo.thingsboard.io/api/plugins/telemetry/:entityType/:entityId/values/attributes", "params": [ { "name": "entityType", "value": "", "type": "path", "description": "A string value representing the entity type. For example, 'DEVICE'" }, { "name": "entityId", "value": "", "type": "path", "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'" }, { "name": "keys", "value": "", "type": "query", "description": "A string value representing the comma-separated list of attributes keys. For example, 'active,inactivityAlarmTime'. If attribute keys contain comma, duplicate 'key' parameter for each key, for example '?key=my,key&key=my,second,key" }, { "name": "params", "value": "", "type": "query" } ] }, "docs": "Returns all attributes that belong to specified entity. Use optional 'keys' parameter to return specific attributes.\n Example of the result: \n\n```json\n[\n {\"key\": \"stringAttributeKey\", \"value\": \"value\", \"lastUpdateTs\": 1609459200000},\n {\"key\": \"booleanAttributeKey\", \"value\": false, \"lastUpdateTs\": 1609459200001},\n {\"key\": \"doubleAttributeKey\", \"value\": 42.2, \"lastUpdateTs\": 1609459200002},\n {\"key\": \"longKeyExample\", \"value\": 73, \"lastUpdateTs\": 1609459200003},\n {\"key\": \"jsonKeyExample\",\n " }, { "info": { "name": "Get Attributes by Scope (getAttributesByScope)", "type": "http" }, "http": { "method": "GET", "url": "https://demo.thingsboard.io/api/plugins/telemetry/:entityType/:entityId/values/attributes/:scope", "params": [ { "name": "entityType", "value": "", "type": "path", "description": "A string value representing the entity type. For example, 'DEVICE'" }, { "name": "entityId", "value": "", "type": "path", "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'" }, { "name": "scope", "value": "", "type": "path", "description": "A string value representing the attributes scope. For example, 'SERVER_SCOPE'." }, { "name": "keys", "value": "", "type": "query", "description": "A string value representing the comma-separated list of attributes keys. For example, 'active,inactivityAlarmTime'. If attribute keys contain comma, duplicate 'key' parameter for each key, for example '?key=my,key&key=my,second,key" }, { "name": "params", "value": "", "type": "query" } ] }, "docs": "Returns all attributes of a specified scope that belong to specified entity. List of possible attribute scopes depends on the entity type: \n\n * SERVER_SCOPE - supported for all entity types;\n * SHARED_SCOPE - supported for devices;\n * CLIENT_SCOPE - supported for devices. \n\nUse optional 'keys' parameter to return specific attributes.\n Example of the result: \n\n```json\n[\n {\"key\": \"stringAttributeKey\", \"value\": \"value\", \"lastUpdateTs\": 1609459200000},\n {\"key\": \"booleanAttributeKey\", \"value\": fals" }, { "info": { "name": "Get Time Series Keys (getTimeseriesKeys)", "type": "http" }, "http": { "method": "GET", "url": "https://demo.thingsboard.io/api/plugins/telemetry/:entityType/:entityId/keys/timeseries", "params": [ { "name": "entityType", "value": "", "type": "path", "description": "A string value representing the entity type. For example, 'DEVICE'" }, { "name": "entityId", "value": "", "type": "path", "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'" } ] }, "docs": "Returns a set of unique time series key names for the selected entity. \n\nReferencing a non-existing entity Id or invalid entity type will cause an error. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority." }, { "info": { "name": "Get All Attribute Keys (getAttributeKeys)", "type": "http" }, "http": { "method": "GET", "url": "https://demo.thingsboard.io/api/plugins/telemetry/:entityType/:entityId/keys/attributes", "params": [ { "name": "entityType", "value": "", "type": "path", "description": "A string value representing the entity type. For example, 'DEVICE'" }, { "name": "entityId", "value": "", "type": "path", "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'" } ] }, "docs": "Returns a set of unique attribute key names for the selected entity. The response will include merged key names set for all attribute scopes:\n\n * SERVER_SCOPE - supported for all entity types;\n * CLIENT_SCOPE - supported for devices;\n * SHARED_SCOPE - supported for devices. \n\nReferencing a non-existing entity Id or invalid entity type will cause an error. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority." }, { "info": { "name": "Get All Attribute Keys by Scope (getAttributeKeysByScope)", "type": "http" }, "http": { "method": "GET", "url": "https://demo.thingsboard.io/api/plugins/telemetry/:entityType/:entityId/keys/attributes/:scope", "params": [ { "name": "entityType", "value": "", "type": "path", "description": "A string value representing the entity type. For example, 'DEVICE'" }, { "name": "entityId", "value": "", "type": "path", "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'" }, { "name": "scope", "value": "", "type": "path", "description": "A string value representing the attributes scope. For example, 'SERVER_SCOPE'." } ] }, "docs": "Returns a set of unique attribute key names for the selected entity and attributes scope: \n\n * SERVER_SCOPE - supported for all entity types;\n * CLIENT_SCOPE - supported for devices;\n * SHARED_SCOPE - supported for devices. \n\nReferencing a non-existing entity Id or invalid entity type will cause an error. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority." }, { "info": { "name": "Delete Entity Time Series Data (deleteEntityTimeseries)", "type": "http" }, "http": { "method": "DELETE", "url": "https://demo.thingsboard.io/api/plugins/telemetry/:entityType/:entityId/timeseries/delete", "params": [ { "name": "entityType", "value": "", "type": "path", "description": "A string value representing the entity type. For example, 'DEVICE'" }, { "name": "entityId", "value": "", "type": "path", "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'" }, { "name": "keys", "value": "", "type": "query", "description": "A string value representing the comma-separated list of telemetry keys. If keys are not selected, the result will return all latest time series. For example, 'temperature,humidity'. If telemetry keys contain comma, duplicate 'key' parameter for each key, for example '?key=my,key&key=my,second,key" }, { "name": "deleteAllDataForKeys", "value": "", "type": "query", "description": "A boolean value to specify if should be deleted all data for selected keys or only data that are in the selected time range." }, { "name": "startTs", "value": "", "type": "query", "description": "A long value representing the start timestamp of removal time range in milliseconds." }, { "name": "endTs", "value": "", "type": "query", "description": "A long value representing the end timestamp of removal time range in milliseconds." }, { "name": "deleteLatest", "value": "", "type": "query", "description": "If the parameter is set to true, the latest telemetry can be removed, otherwise, in case that parameter is set to false the latest value will not removed." }, { "name": "rewriteLatestIfDeleted", "value": "", "type": "query", "description": "If the parameter is set to true, the latest telemetry will be rewritten in case that current latest value was removed, otherwise, in case that parameter is set to false the new latest value will not set." }, { "name": "params", "value": "", "type": "query" } ] }, "docs": "Delete time series for selected entity based on entity id, entity type and keys. Use 'deleteAllDataForKeys' to delete all time series data. Use 'startTs' and 'endTs' to specify time-range instead. Use 'deleteLatest' to delete latest value (stored in separate table for performance) if the value's timestamp matches the time-range. Use 'rewriteLatestIfDeleted' to rewrite latest value (stored in separate table for performance) if the value's timestamp matches the time-range and 'deleteLatest' para" } ] } ], "bundled": true }