Skip to main content
Version: 1.1beta1

integration.insert

This call inserts data for one or more signals. Each signal is uniquely identified by its input ID in combination with the integration ID. If no signal with the given combination exists, an empty signal is created.

An integration can only interact with it's own signals using this call.

Example​

# BASIC_AUTH_USERNAME=<Username from Basic Auth credentials>
# BASIC_AUTH_PASSWORD=<Password from Basic Auth credentials>
# INTEGRATION_ID=${BASIC_AUTH_USERNAME}
curl -u ${BASIC_AUTH_USERNAME}:${BASIC_AUTH_PASSWORD} \
--request POST \
--url https://api.clarify.io/v1/rpc \
--header 'Content-Type: application/json' \
--header 'X-API-Version: 1.1beta1' \
--data \
'
{
"jsonrpc" : "2.0",
"method": "integration.insert",
"id": "1",
"params": {
"integration": "'${INTEGRATION_ID}'",
"data":{
"times" : ["2021-03-11T21:00:00Z", "2021-03-11T22:00:00Z"],
"series": {
"a": [1.0, 1.2],
"b": [2.0, null]
}
}
}
}
'

Method parameters​

NameTypeRequiredDescription
integrationIntegration IDYesThe ID if the integration to save signal information for.
dataData frameYesThe data to insert accompanied by timestamps.

Result properties​

NameTypeDescription
signalsByInputmap of Input ID => Save summarySave operation summary per input.

Limits​

Data property:

  • Signals SHOULD not have an average same rate of more than 1 sample/min.
  • Signals SHOULD not have a burst sample rate of more than 1 sample/sec.
  • Clarify CAN NOT show timestamps with more than one millisecond resolution (ms).
  • Clarify CAN NOT store timestamps with more than microsecond resolution (µs).

Billing​

Typically plans restrict the number of signals and the number of inserted data points per day.

Exceeding the limitations allowed by your plan may result in additional charges.

Schema references​

Data frame​

Data frame holds data for one or more time-series.

type: object

Properties​

NameTypeRequiredDescription
timesarray of TimestampYesArray of timestamps to insert.
seriesmap of Input ID => array of (number or null)YesArray of data points to insert by Input ID. The length of each array must match that of the times array. To omit a value for a given timestamp in times, use the value null.

Timestamp​

type: string OR number(integer)

Timestamp must either be a RFC 3339 date-time string or an integer containing a UNIX timestamp. A UNIX timestamp is always defined as the number of seconds that has elapsed since the "epoch" (1970-01-01T00:00:00:00Z).

When using an RFC 3339 date-time string, Clarify can store a maximum resolution of one microsecond (µs).

Example​

{
"times": [
"2021-03-11T21:49:00Z",
"2021-03-11T21:50:00Z",
"2021-03-11T21:51:00.00123Z",
"2021-04-08T00:00:00Z"
],
"series": {
"banana-stand-temp": [-10, 10, 20, 55.3, 231, 34],
"banana-stand-cash": [10000000, null, null, null, null, 0]
}
}

Input ID​

Input ID routes data to a signal during insert. The input ID must be unique per integration only.

type: string(regex: ^[a-zA-Z0-9-_:.#+/]{1,128}$)

Integration ID​

Integration ID uniquely identities a integration resource entry.

type: string(regex: "^[a-v0-9]{20}$")

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
}