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.

Rates and limits

API:

  • The API is rate-limited to 1 request/sec.
  • The JSON encoded size of the request MUST not be more than 9MiB.

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 (µs).

Billing:

  • Signals above the amount allowed by your selected plan, may be charged.

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.

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
}