HTTP POST not working


#1

This is what I send:

POST /app/devices/< my device id > HTTP/1.1
Host:things.ubidots.com
X-Auth-token:" "
Content-Type: application/json
Content-Length: 52

[{“variable”:" my variable id ",“value”:50}]

I get this in return:
HTTP/1.1 302 Found
Cache-Control: no-cache
Content-length: 0
Location: https://app.ubidots.com
Connection: close

No data is generated, do anyone see a basic error?

I’ve tried both port 80 and 443 using industrial.api.ubidots.com, but then I get 302 Moved Temporarily.

Any hints or tips are appreciated. Thanks.


#2

Solved it using:

POST /api/v1.6/devices//?token=my token HTTP/1.1
Host:industrial.api.ubidots.com
Content-Type: application/json
Content-Length: 11

{“demo”:50}


#3

Greetings, the endpoint below does not fit our REST API if you are planning to use the variable ID:

Referencing our [docs](https://ubidots.com/docs/sw/#operation/Create Variable Value), the endpoint should be https://industrial.api.ubidots.com/api/v1.6/variables/{id}/values/. Also, your JSON does not fit the our REST API, please refer to the [docs](https://ubidots.com/docs/sw/#operation/Create Variable Value) for more information.

All the best