Skip to main content
Version: 1.1beta1

admin.publishSignals

Require access to Admin namespace

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​

# 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​

NameTypeRequiredDescription
integrationIntegration IDYesThe integration to publish signals for.
itemsBySignalSignal ID => Item save viewYesMap of signal IDs to item meta-data.
createOnlyBooleanNo (default=false)If set to true, skip update of information for existing items.

Response result​

type: object

Properties​

NameTypeDescription
itemsBySignalmap of Item ID => Save summarySave 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​

NameTypePropertiesDescription
annotationsmap of string(regex: "^[A-Za-z0-9-_/]{1,128}$") => stringdefault = {}Arbitrary configuration parameters. Customer-provided annotations should use a relevant prefix, e.g. company-domain/application-name/.
namestringrequiredThe default signal display name.
typestring(numeric or enum)requiredThe default signal type.
sourceTypestring("measurement" or "aggregation" or "prediction")requiredDefault item source type.
descriptionstringdefault = ""The default signal description
labelsmap of string(regex: "^[A-Za-z0-9-_/]{1,128}$") => array of stringdefault = {}The default signal labels.
engUnitstringdefault = ""Default signal display unit, used in numeric representations.
enumValuesmap of string(integer in range 0-9999) => stringdefault = {}Default item enum values, used to replace numeric values with text in enumerated representations.
sampleIntervalnull or string(RFC 3339 duration)default = nullHow often the signal is sampled (on average).
gapDetectionnull or string(RFC 3339 duration)default = nullThe 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​

NameTypeDescription
contentHashstringHash of "relevant" fields in the resource (better definition in expected next API version)
createdAtstring(RFC 3339 timestamp)When the resource was created.
updatedAtstring(RFC 3339 timestamp)When the resource was updated.

Save summary​

type: object

Properties​

NameTypeDescription
idstringUnique ID of the saved resource entry.
createdbooleanTrue 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}$")