Hello @CeJay,
The bad request (400) is generated because the double quotation marks used in the request are not the proper ones.
Try the following request to handle your data with Ubidots:
curl -X POST -H "X-Auth-Token:BBFF-xxxxxxxxxxxxxxxxxxx" -H "Content-Type:application/json" -d '{"value": 59}' https://industrial.api.ubidots.com/api/v1.6/devices/mqttdata/number/values -vvv
Server response expected:
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 169.55.61.243:443...
* TCP_NODELAY set
* Connected to industrial.api.ubidots.com (169.55.61.243) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use http/1.1
* Server certificate:
* subject: CN=industrial.api.ubidots.com
* start date: Nov 11 20:11:54 2019 GMT
* expire date: Feb 9 20:11:54 2020 GMT
* subjectAltName: host "industrial.api.ubidots.com" matched cert's "industrial.api.ubidots.com"
* issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
* SSL certificate verify ok.
> POST /api/v1.6/devices/mqttdata/number/values HTTP/1.1
> Host: industrial.api.ubidots.com
> User-Agent: curl/7.65.3
> Accept: */*
> X-Auth-Token:BBFF-xxxxxxxxxxxxxxxxxxx
> Content-Type:application/json
> Content-Length: 13
>
* upload completely sent off: 13 out of 13 bytes
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* Mark bundle as not supporting multiuse
< HTTP/1.1 201 Created
< Server: nginx
< Date: Wed, 04 Dec 2019 19:58:38 GMT
< Content-Type: application/json
< Transfer-Encoding: chunked
< Connection: keep-alive
< Location: https://industrial.api.ubidots.com/api/v1.6/values/5de80fee73efc3287211cb65
< Vary: Accept, Origin, Cookie
< Allow: GET, POST, HEAD, OPTIONS
<
* Connection #0 to host industrial.api.ubidots.com left intact
{"url": "https://industrial.api.ubidots.com/api/v1.6/values/5de80fee73efc3287211cb65", "value": 59.0, "timestamp": 1575489518079, "context": {}, "created_at": "2019-12-04T19:58:38.079391Z"}
All the best,
Maria H.