xmin and xmax via api

Does the API offer a way to adjust the xmin and xmax values? I’ve done a decent amount of exploring and can’t find anything.

The problem I’m trying to solve is to have the graphs reflect a constant amount of time, so they don’t end up zooming out indefinitely, without having to regularly manually adjust them.

5 Likes

@dreev and friend workerbees will absolutely hate me for even typing this (maybe a bit of an exaggeration) but a very bad solution for now would be:

  1. obtain a website cookie from https://api.beeminder.com/#redirectuser
  2. GET the CSRF token from https://www.beeminder.com/gfredericks/goal_name
  3. POST the settings to https://www.beeminder.com/gfredericks/goal_name

Obviously terrible for many reasons, but as a temporary solution, if you don’t want to be adjusting a large amount of goals manually all the time…

3 Likes

For what it’s worth, I’ve… actively considered doing this to add support in altbee for this and a few other similar things. I haven’t, yet, though altbee does do a simplified version of this (just the cookie, no need for a CSRF token) for getting the tags associated with each goal (briefly described here.)

Yeah, it’s hardly ideal—but it works, and if there are other feature in the future which I want to add to altbee that also need to work this way, well, I’ll probably go for it, CSRF token and all (though I can’t quite say I don’t have a few misgivings about it…)

2 Likes

As far as I can tell in the source, it does not. Internally, it’s called tmin.

I’ve added this to our issue tracker.

2 Likes

As Adam says, it’s called tmin. I set it by script all the time, using yyyy-mm-dd date format.

A fragment from my tmin script

curl -# -X PUT -d "{\"tmin\":\"$TMIN\"}" https://www.beeminder.com/api/v1/users/$username/goals/$GOAL.json?auth_token=$auth_token --header "Content-Type: application/json"

2 Likes

oh hey that works! thanks

much easier than the cookie route, which I couldn’t entirely get to work

2 Likes

this is officially in the api now :slight_smile:

2 Likes

great, thanks!