In this article
Post Samples to Multiple Timeseries IDs
This endpoint is used to post sample multiple timeseries IDs at once. A list of samples are provided in the body of the POST request. If you post more than 500 samples, it results in multiple psrIds in the returned response.
URL
https://{{HOST}}/timeseries/samples
Method
POST
Required IMS Scopes
- Read
- Write
Required ACL Permissions
- owner
- admin
- readwrite
Versions Supported
- 2.0 (Default)
- 2.1
URL Path Parameters
| Name | Description | Example | Type |
|---|---|---|---|
| timeseriesId required |
Timeseries ID that the samples are posted to | GUID | string |
URL Query Parameters
| Name | Description | Example | Type |
|---|---|---|---|
| v optional |
Version of the API to use | v=2.0 | string |
Request Header Parameters
| Type | Value | Description |
|---|---|---|
| Authentication required |
Bearer {access_token} | Retrieve access token |
| Content-Type required |
application/json | |
| Content-Encoding optional |
gzip | Allows you to post the samples in a gzip format |
Request Body Parameters
| Name | Description | Schema |
|---|---|---|
| timeseriesId required |
Timeseries the TSElement belogs to | string |
| metric required |
Metric of the sample | string |
| timestamp required |
Timestamp of the sample | string(date-time) |
| val required |
Value of the sample | object |
| customData optional |
Application specific data can be stored here | Dictionary<string,object> |
Example
Request
curl -X POST
'https://{{HOST}}/timeseries/samples'
-H 'authorization: Bearer {access_token}'
-H 'cache-control: no-cache'
-H 'content-type: application/json'
-d '[
{ "timeseriesId": "f3c4cbf4-dfec-4e69-a99e-010c6757ab3a", "val": 6, "timestamp": "2018-03-27T21:28:00+00:00", "metric": "Raw", "customData": {"reliability": 1}},
{ "timeseriesId": "f3c4cbf4-dfec-4e69-a99e-010c6757ab3a", "val": 7, "timestamp": "2018-03-27T21:29:00+00:00", "metric": "Raw", "customData": {"reliability": "Low"}},
{ "timeseriesId": "dd48eee2-86cb-46e3-9fa9-333bea08973a", "val": 98, "timestamp": "2018-03-27T21:28:00+00:00", "metric": "Raw", "customData": {"reliability": 3}},
{ "timeseriesId": "dd48eee2-86cb-46e3-9fa9-333bea08973a", "val": 99, "timestamp": "2018-03-27T21:29:00+00:00", "metric": "Raw", "customData": {"reliability": "High"}}
]
'
Response
{
"psrIds": [
"748665aa-7fa2-4fe9-9658-1ee8b22ef355"
]
}
| Error | Description |
|---|---|
| 403 | Forbidden |