admin.publishSignals
For an integration to access this method, it must have been granted access to the Admin namespace in Clarify.
This call creates or updates a set of signals with the provided meta data. Each signal is uniquely identified by its input ID in combination with the integration ID.
Billing
Typically plans restrict the number of items you can publish.
Exceeding the limitations allowed by your plan may result in additional charges.
Example
- cURL
# BASIC_AUTH_USERNAME=<Username from Basic Auth credentials>
# BASIC_AUTH_PASSWORD=<Password from Basic Auth credentials>
# INTEGRATION_ID=${BASIC_AUTH_USERNAME}
# SIGNAL_A=<a signal ID from admin.selectSignals result>
# SIGNAL_B=<a signal ID from admin.selectSignals result>
curl --request POST \
--url 'https://api.clarify.io/v1/rpc' \
--header 'content-type: application/json' \
--header 'Authorization: Bearer <YOUR ACCESS TOKEN>' \
--header 'X-API-Version: 1.1beta1' \
--data \
'
{
"jsonrpc" : "2.0",
"method" : "admin.publishSignals",
"id" : "1",
"params" : {
"integration": "'${INTEGRATION_ID}'",
"itemsBySignal": {
"'${SIGNAL_A}'" : {
"annotations": {
"your-company-domain/your-app-name/generated-from/signal/attributes-hash": "<signal-a.meta.contentHash>",
"your-company-domain/your-app-name/generated-from/signal/id": "<signal-a.id>"
},
"name": "Item A",
"type": "numeric",
"sourceType": "measurment",
},
"'${SIGNAL_B}'" : {
"annotations": {
"your-company-domain/your-app-name/generated-from/signal/attributes-hash": "<signal-b.meta.contentHash>",
"your-company-domain/your-app-name/generated-from/signal/id": "<signal-b.id>"
},
"name": "Item B",
"type": "enum",
"sourceType": "aggregation",
}
},
"createOnly": false
}
}
'
Method parameters
| Name | Type | Required | Description |
|---|---|---|---|
integration | Integration ID | Yes | The integration to publish signals for. |
itemsBySignal | Signal ID => Item save view | Yes | Map of signal IDs to item meta-data. |
createOnly | Boolean | No (default=false) | If set to true, skip update of information for existing items. |
Response result
type: object
Properties
| Name | Type | Description |
|---|---|---|
itemsBySignal | map of Item ID => Save summary | Save operation summary for updated or created items mapped by signal ID. |
Schema references
Integration ID
Integration ID uniquely identities a integration resource entry.
type: string(regex: "^[a-v0-9]{20}$")
Item ID
Item ID uniquely identities a item resource entry.
type: string(regex: "^[a-v0-9]{20}$")
Item save view
The item save view lists all writable item fields. This view is the same as the SignalSaveView, except there are some required properties.
type: object
Properties
| Name | Type | Properties | Description |
|---|---|---|---|
annotations | map of string(regex: "^[A-Za-z0-9-_/]{1,128}$") => string | default = {} | Arbitrary configuration parameters. Customer-provided annotations should use a relevant prefix, e.g. company-domain/application-name/. |
name | string | required | The default signal display name. |
type | string(numeric or enum) | required | The default signal type. |
sourceType | string("measurement" or "aggregation" or "prediction") | required | Default item source type. |
description | string | default = "" | The default signal description |
labels | map of string(regex: "^[A-Za-z0-9-_/]{1,128}$") => array of string | default = {} | The default signal labels. |
engUnit | string | default = "" | Default signal display unit, used in numeric representations. |
enumValues | map of string(integer in range 0-9999) => string | default = {} | Default item enum values, used to replace numeric values with text in enumerated representations. |
sampleInterval | null or string(RFC 3339 duration) | default = null | How often the signal is sampled (on average). |
gapDetection | null or string(RFC 3339 duration) | default = null | The default item gap detection. A gap will be drawn whenever there is no data for a duration longer than the specified value. |
Example
{
"name": "Ice Cream Temperature",
"type": "numeric",
"description": "Temperature measurement of the ice cream",
"labels": {
"flavours": ["sweet", "sour"],
"location": ["pier", "banana stand"]
},
"engUnit": "°C",
"sourceType": "measurement",
"sampleInterval": "PT1M",
"gapDetection": "PT5M"
}
Resource meta
type: object
Properties
| Name | Type | Description |
|---|---|---|
contentHash | string | Hash of "relevant" fields in the resource (better definition in expected next API version) |
createdAt | string(RFC 3339 timestamp) | When the resource was created. |
updatedAt | string(RFC 3339 timestamp) | When the resource was updated. |
Save summary
type: object
Properties
| Name | Type | Description |
|---|---|---|
id | string | Unique ID of the saved resource entry. |
created | boolean | True if a new instance was created. |
Example
{
"id": "c9137visahsjsdhrim6g",
"created": true
}
Signal ID
Signal ID uniquely identities a signal resource entry.
type: string(regex: "^[a-v0-9]{20}$")