integration.insert
A data method for inserting time-series data to signals using an input key that's unique in combination with an integration ID. If no signal with a given key exists for the integration, it's automatically created. The input is made available on each signal as a read-only attribute. An integration can only interact with it's own signals using this call.
Method parameters
| Parameter | Properties | Description |
|---|---|---|
integrationIntegration ID | required | The ID if the integration to save signal information for. |
dataData frame | required | The data to insert. |
Result
The result contain a map that links each input key in the request to a signal create summary, which include a globally unique signal ID.
type: object
| Field | Description |
|---|---|
signalsByInputmap(Series key => Create summary) | Save operation summary for signals mapped by their input key. |
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 (µ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.
Example
- cURL
- Python
The curl example uses Basic Auth for simplicity.
# 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.1' \
--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]
}
}
}
}
'
from pyclarify import Client, DataFrame
client = Client("./clarify-credentials.json")
data = DataFrame(
series={
"a": [1.0, 1.2],
"b": [2.0, null]
},
times=["2021-03-11T21:00:00Z", "2021-03-11T22:00:00Z"]
)
client.insert(data)