You can also send one or multiple dots to a single variable.
curl -X POST ' https://industrial.ubidots.com/api/v1.6/devices/my-new-device/my-variable/values'
-H "X-Auth-Token: BBFF-Rfcgaxns6HlVb155WA0RhSY85xNDmB"
-H "Content-Type: application/json"
-d '{"value": 27}'
curl -X POST 'https://industrial.ubidots.com/api/v1.6/devices/my-new-device/my-variable/values'
-H "X-Auth-Token: BBFF-Rfcgaxns6HlVb155WA0RhSY85xNDmB"
-H "Content-Type: application/json"
-d '[{"value": 27, "timestamp":1514808000000}, {"value": 12, "timestamp":1514808900000}]'
Request
POST /api/v1.6/devices/{DEVICE_LABEL}/{VARIABLE_LABEL}/values HTTP/1.1<CR><LN>
Host: {Endpoint}<CR><LN>
User-Agent: {USER_AGENT}<CR><LN>
X-Auth-Token: {TOKEN}<CR><LN>
Content-Type: application/json<CR><LN>
Content-Length: {PAYLOAD_LENGTH}<CR><LN><CR><LN>
{PAYLOAD}
<CR><LN>
Response
HTTP/1.1 201 Created<CR><LN>
Server: nginx<CR><LN>
Date: Tue, 04 Sep 2018 22:50:55 GMT<CR><LN>
Content-Type: application/json<CR><LN>
Transfer-Encoding: chunked<CR><LN>
Vary: Accept, Cookie<CR><LN>
Location: http://industrial.api.ubidots.com/api/v1.6/values/{VARIABLE_ID}<CR><LN>
Allow: GET, POST, HEAD, OPTIONS<CR><LN><CR><LN>
{PAYLOAD_LENGTH_IN_HEXADECIMAL}<CR><LN>
{"url": "http://industrial.api.ubidots.com/api/v1.6/values/{VARIABLE_ID}", "value": 27.0, "timestamp": 1536101455822, "context": {}, "created_at": "2018-09-04T22:50:55.822035Z"}<CR><LN>
0<CR><LN>
In the path specified above, replace the {DEVICE_LABEL} and {VARIABLE_LABEL} keys with the unique labels of the Ubidots device and variable you wish to send data to. If the specified device and/or variable do not exist, they will be created automatically.
`{
"value": VALUE, "timestamp": TIMESTAMP, "context": {"key": CONTEXT_VALUE}}
}`
`[
{
"value": VALUE, "timestamp": TIMESTAMP, "context": {"key": CONTEXT_VALUE}}
},
{
"value": VALUE, "timestamp": TIMESTAMP, "context": {"key": CONTEXT_VALUE}}
},
...
]`
Examples
{"value":27}
{
"value":27,
"timestamp": 1514808000000,
"context":
{
"lat":37.773,
"lng":-122.431
}
}
[
{"value": 27,
"timestamp":1514808000000
},
{
"value": 12,
"timestamp":1514808900000
}
]