Signals¶
Approving Signals¶
Create and approve signals within an account.
Request Payload
{ "flowType": "CLUESOURCE", "name": "Creating approved signals via API", "spec": { "sourceMappings": [ { "name": "string", "description": "string", "valueType": "NUMERIC or CATEGORICAL", "unit": "string" }, { "name": "string", "description": "string", "valueType": "NUMERIC or CATEGORICAL", "unit": "string" } ] } }
Example request
::::: tabs ::: code-tab bash
- \$ curl --location --request POST \'https://app3.falkonry.ai/api/1.2/accounts/xxxxxxxxxxxxxxx/flows\' --header \'Authorization: Bearer \<token>\' --header \'Content-Type: application/json\' --data-raw \'{
\"flowType\": \"CLUESOURCE\", \"name\": \"Creating approved signals via API\", \"spec\": { \"sourceMappings\": [ { \"name\": \"plant1/machine1/subsystem1/pressure\", \"description\": \"Pressure sensor of machine1/subsystem1\", \"valueType\": \"NUMERIC\", \"unit\": \"Pa\" }, { \"name\": \"plant1/machine1/subsystem1/voltage\", \"description\": \"Voltage output of machine1/subsystem1\", \"valueType\": \"NUMERIC\", \"unit\": \"V\" } ] } }\'
:::
::: code-tab python
import requests import json
URL = \'https://app3.falkonry.ai/api/1.2/accounts/xxxxxxxxxxxxxxx/flows\' TOKEN = \'\<token>\' HEADERS = {\'Authorization\': f\'Bearer {TOKEN}\'} PAYLOAD = { \"flowType\": \"CLUESOURCE\", \"name\": \"Creating approved signals via API\", \"spec\": { \"sourceMappings\": [ { \"name\": \"plant1/machine1/subsystem1/pressure\", \"description\": \"Pressure sensor of machine1/subsystem1\", \"valueType\": \"NUMERIC\", \"unit\": \"Pa\" }, { \"name\": \"plant1/machine1/subsystem1/voltage\", \"description\": \"Voltage output of machine1/subsystem1\", \"valueType\": \"NUMERIC\", \"unit\": \"V\" } ] } }
response = requests.post(URL, headers=HEADERS, data=json.dumps(PAYLOAD)) print(response.json()) ::: :::::
Example response
{ "id": "1124191510837645312", "type": "entities.flow", "flowType": "CLUESOURCE", "status": "CREATED", "name": "Creating approved signals via API", "description": "", "spec": { "sourceMappings": [ { "name": "plant1/machine1/subsystem1/pressure", "description": "Pressure sensor of machine1/subsystem1", "valueType": "NUMERIC", "unit": "Pa" }, { "name": "plant1/machine1/subsystem1/voltage", "description": "Voltage output of machine1/subsystem1", "valueType": "NUMERIC", "unit": "V" } ] }, "createTime": 1688098542651, "updateTime": 1688098542651, "createdBy": "1013056801100267520", "updatedBy": "1013056801100267520", "archived": false, "links": [] }
Note
Track the CLUESOURCE activity within the Activity view UI and wait for this activity to complete.
Get Signals List¶
Gets Signal list within an account. This API can be used to get all Signals or filter by name.
Query Parameters¶
- ?sourceName=
Name of the signal. By default, it performs a contains match. To match the exact signal name, set the value with double quotes.
- ?offset=
Index to start for the next paginated request. Default value is
0
.
- ?limit=
Number of items to include in each page result. There could be fewer items remaining than the specified value.
Example request
::::: tabs ::: code-tab bash
\$ curl -H \"Authorization: Bearer \<token>\" https://app3.falkonry.ai/api/1.2/accounts/xxxxxxxxxxxxxxx/connectedsources?offset=0&limit=10&sourceName=\\"San Francisco/P\" :::
::: code-tab python
import requests URL = \'https://app3.falkonry.ai/api/1.2/accounts/xxxxxxxxxxxxxxx/connectedsources/?offset=0&limit=10&sourceName=\"San Francisco/P\"\' TOKEN = \'\<token>\' HEADERS = {\'Authorization\': f\'Bearer {TOKEN}\'} response = requests.get(URL, headers=HEADERS) print(response.json()) ::: :::::
Example response
[ { "id": "yyyyyyyyyyyy", "tenant": "xxxxxxxxxxxxxxx", "unit": "in", "sourceName": "San Francisco/P", "valueType": "Numeric", "firstPoint": "2008-08-01T00:00:00.000000Z", "lastPoint": "2016-12-28T21:00:00.000000Z", "pointsCount": 24576, "layoutinfo": [ { "layout": "1000001081909198848", "layoutnode": "1000001082064388096", "path": [ { "name": "US", "id": "1000001082018250752", "seq": 1 }, { "name": "San Francisco", "id": "1000001082064388096", "seq": 2 } ], "materializedPath": "US->San Francisco", "layoutState": "PUBLISHED" }, { "layout": "989393423730286592", "layoutnode": "1012335760928661504", "path": [ { "name": "US", "id": "1012335760224018432", "seq": 1 }, { "name": "San Francisco", "id": "1012335760928661504", "seq": 2 } ], "materializedPath": "US->San Francisco", "layoutState": "DRAFT" } ], "description": "Pressure", "links": [] } ]
Note
To paginate through results, begin with an offset value of 0 and a limit value of N. To get the next page, set offset value to N, while the limit value stays the same. Subsequent pages start at 2N, 3N, 4N, and so on.
Get a Signal¶
Get a Signal by ID within an account.
Example request
::::: tabs ::: code-tab bash
\$ curl -H \"Authorization: Bearer \<token>\" https://app3.falkonry.ai/api/1.2/accounts/xxxxxxxxxxxxxxx/connectedsources/yyyyyyyyyyyy :::
::: code-tab python
import requests URL = \'https://app3.falkonry.ai/api/1.2/accounts/xxxxxxxxxxxxxxx/connectedsources/yyyyyyyyyyyy\' TOKEN = \'\<token>\' HEADERS = {\'Authorization\': f\'Bearer {TOKEN}\'} response = requests.get(URL, headers=HEADERS) print(response.json()) ::: :::::
Example response
{ "id": "yyyyyyyyyyyy", "tenant": "xxxxxxxxxxxxxxx", "unit": "in", "sourceName": "San Francisco/P", "valueType": "Numeric", "firstPoint": "2008-08-01T00:00:00.000000Z", "lastPoint": "2016-12-28T21:00:00.000000Z", "pointsCount": 24576, "layoutinfo": [ { "layout": "1000001081909198848", "layoutnode": "1000001082064388096", "path": [ { "name": "US", "id": "1000001082018250752", "seq": 1 }, { "name": "San Francisco", "id": "1000001082064388096", "seq": 2 } ], "materializedPath": "US->San Francisco", "layoutState": "PUBLISHED" }, { "layout": "989393423730286592", "layoutnode": "1012335760928661504", "path": [ { "name": "US", "id": "1012335760224018432", "seq": 1 }, { "name": "San Francisco", "id": "1012335760928661504", "seq": 2 } ], "materializedPath": "US->San Francisco", "layoutState": "DRAFT" } ], "description": "Pressure", "links": [] }