Signals¶
Approving Signals¶
Approve signals to create them 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"
}
]
}
}
cURL request¶
$ 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"}
]}}'
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": []
}
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 is0
.?limit=
: Number of items to include in each page result. There could be fewer items remaining than the specified value.
cURL request¶
$ curl -H "Authorization: Bearer <token>"
"https://app3.falkonry.ai/api/1.2/accounts/xxxxxxxxxxxxxxx/connectedsources?offset=0&limit=10&sourceName=%22SanFrancisco/P"
Python¶
import requests
URL = 'https://app3.falkonry.ai/api/1.2/accounts/xxxxxxxxxxxxxxx/connectedsources/?offset=0&limit=10&sourceName="SanFrancisco/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": []
}
]
Get Signal Info¶
Get signal info using signal ID within an account.
cURL request¶
$ curl -H "Authorization: Bearer <token>" \
"https://app3.falkonry.ai/api/1.2/accounts/xxxxxxxxxxxxxxx/connectedsources/yyyyyyyyyyyy"
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": []
}