Help adding a datapoint from Tasker using Beeminder API

I’ve used the API a lot from both curl and Python, and it basically works the way it says it does.

When you do something like:

curl -X POST https://www.beeminder.com/api/v1/users/alice/goals/weight/datapoints.json
-d auth_token=abc123
-d timestamp=1325523600
-d value=130.1
-d comment=sweat+a+lot+today

per the docs, you’re using curl’s -d, which basically sends it like a webbrowser does.

  -d, --data <data>

         (HTTP) Sends the specified data in  a  POST  request  to  the  HTTP

         server,  in the same way that a browser does when a user has filled

         in an HTML form and presses the submit button. This will cause curl

         to  pass  the  data  to  the server using the content-type applica-

         tion/x-www-form-urlencoded.  Compare to -F, --form.

Lemme do one with curl and get all the headers for you:

$ curl -v -X POST https://www.beeminder.com/api/v1/users/adamwolf/goals/coffeeless_days/datapoints.json -d auth_token=REDACTED -d value=1 -d comment=helloworld

Note: Unnecessary use of -X or --request, POST is already inferred.

  • Trying 23.92.16.25…

  • TCP_NODELAY set

  • Connected to www.beeminder.com (23.92.16.25) port 443 (#0)

  • ALPN, offering h2

  • ALPN, offering http/1.1

  • Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH

  • successfully set certificate verify locations:

  • CAfile: /etc/ssl/cert.pem

CApath: none

  • TLSv1.2 (OUT), TLS handshake, Client hello (1):

  • TLSv1.2 (IN), TLS handshake, Server hello (2):

  • TLSv1.2 (IN), TLS handshake, Certificate (11):

  • TLSv1.2 (IN), TLS handshake, Server key exchange (12):

  • TLSv1.2 (IN), TLS handshake, Server finished (14):

  • TLSv1.2 (OUT), TLS handshake, Client key exchange (16):

  • TLSv1.2 (OUT), TLS change cipher, Client hello (1):

  • TLSv1.2 (OUT), TLS handshake, Finished (20):

  • TLSv1.2 (IN), TLS change cipher, Client hello (1):

  • TLSv1.2 (IN), TLS handshake, Finished (20):

  • SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384

  • ALPN, server accepted to use http/1.1

  • Server certificate:

  • subject: OU=Domain Control Validated; CN=*.beeminder.com

  • start date: Sep 15 01:00:49 2015 GMT

  • expire date: Sep 15 01:00:49 2018 GMT

  • subjectAltName: host “www.beeminder.com” matched cert’s “*.beeminder.com”

  • issuer: C=BE; O=GlobalSign nv-sa; CN=AlphaSSL CA - SHA256 - G2

  • SSL certificate verify ok.

> POST /api/v1/users/adamwolf/goals/coffeeless_days/datapoints.json HTTP/1.1

> Host: www.beeminder.com

> User-Agent: curl/7.54.0

> Accept: /

> Content-Length: 58

> Content-Type: application/x-www-form-urlencoded

>

  • upload completely sent off: 58 out of 58 bytes

< HTTP/1.1 200 OK

< Content-Type: application/json; charset=utf-8

< Transfer-Encoding: chunked

< Connection: keep-alive

< Status: 200 OK

< Cache-Control: max-age=0, private, must-revalidate

< X-XSS-Protection: 1; mode=block

< X-Request-Id: 7b49bcb9-0d80-45d9-be78-50e5acf5563e

< X-UA-Compatible: chrome=1

< ETag: “415d47182e8c853ae81f4d45f04a76d7”

< X-Frame-Options: SAMEORIGIN

< X-Runtime: 0.213489

< X-Content-Type-Options: nosniff

< Date: Wed, 08 Aug 2018 13:37:04 GMT

< Set-Cookie: _beeminder_session=REDACTED; path=/; HttpOnly

< X-Powered-By: Phusion Passenger Enterprise 5.1.10

< Server: nginx/1.12.1 + Phusion Passenger 5.1.10

<

{“timestamp”:1533735424,“value”:1.0,“comment”:“helloworld”,“id”:“5b6af200bfec0316940003e7”,“updated_at”:1533735424,“requestid”:null,“canonical”:“08 1 "helloworld"”,“fulltext”:“2018-Aug-08 entered at 08:37 via api”,“origin”:“api”,“daystamp”:“20180808”,“status”:“created”}%

I think that without another user who has already done this, your best bet may be to email support. They miiight be able to take a look at your API calls. Maybe it’s something silly like Autoweb is sending GETs instead?

Please let us know if you figure it out!

On Wed, Aug 8, 2018 at 8:06 AM imoatama <beeminder@discoursemail.com> wrote:

imoatama
August 8

OK, I have managed to get it to add a datapoint via Autoweb after adding in the www to the address, and by submitting the value parameter as a “Query” type input in autoweb- ie url encoded. But it only seems to use one of the variables this way - my comment input was ignored.

Posting with a message body of eg value=1&comment=test causes it to flame out with some new and different error.

Visit Topic or reply to this email to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, click here.

1 Like