Beeminder API Documentation

Introduction

The base URL for all requests is https://www.beeminder.com/api/v1/

This API is under active development but by releasing it as a 1.0 we’re committing to make any future changes backwards compatible and give plenty of warning if we do have to stop supporting prior versions or endpoints. We have been compiling a list of ways people are using the Beeminder API on our blog.

You may also consume the Beeminder API via Mashape:    

Contents


Authentication

All API endpoints require authentication. There are two ways to authenticate.

Personal authentication token

This authentication pattern is for making API calls just to your own Beeminder account.

After you log in to Beeminder, visit https://www.beeminder.com/api/v1/auth_token.json to get your personal auth token. Append it to API requests you make as an additional GET or POST parameter. For example, if your username is “alice” and your token is “abc123” you can query information about your “weight” goal like so:

  GET https://www.beeminder.com/api/v1/users/alice/goals/weight.json?auth_token=abc123

Client Oauth

This authentication pattern is for clients (applications) accessing the Beeminder API on a user’s behalf. Beeminder implements the OAuth (specifically oauth2) provider protocol to allow access reasonably securely.

There are four steps to build a client:

1. Register your app

Register your app at beeminder.com/apps/new. Application name and redirect URL are required. The redirect URL is where the user is sent after authorizing your app. You can optionally specify a URL that users are redirected to if they deauthorize as well.

2. Send your users to the Beeminder authorization URL

The base URL is the same for all apps: https://www.beeminder.com/apps/authorize. You’ll need to add the following parameters:

  • client_id: Your application’s client ID. You can see a list of your registered apps and retrieve their client_ids at beeminder.com/apps.
  • redirect_uri: This is where Beeminder will send the user after they have authorized your app. This must match the redirect URL you supplied when you registered your app above. Make sure to url-encode this if it contains any special characters like question marks or ampersands.
  • response_type: Currently this should just always be set to the value “token”.

Example authorization URL:

  https://www.beeminder.com/apps/authorize?client_id=xyz456&redirect_uri=http://example.com/auth_callback&response_type=token

3. Receive and store user’s access token

If the user authorizes your application, they will be redirected to the redirect_uri that you specified, with two additional parameters, access_token and username, in the query string. For example, if the user “alice” has access token “abc123” then the following string would be appended to the URL:

  ?access_token=abc123&username=alice

You should set up your server to handle this GET request and associate the access token with the user. The access token uniquely identifies the user’s authorization for your app.

The username is provided here for convenenience. You can retrieve the username for a given access token at any time sending a GET to /api/v1/me.json with the token appended as a parameter.

4. Include access token as a parameter

Append the access token as a parameter on any API requests you make on behalf of that user. For example, your first request will probably be to get information about the User who just authorized your app and so will look something like this:

  GET https://www.beeminder.com/api/v1/users/me.json?access_token=abc123

Note that you can literally use “me” in place of the username for any endpoint and it will be macro-expanded to the username of the authorized user.

User Resource

A User object (using “object” in the JSON sense) includes information about a user, like their list of goals.

Attributes

  • username (string)
  • timezone (string)
  • updated_at (number): Unix timestamp (in seconds) of the last update to this user or any of their goals or datapoints.
  • goals (array): A list of slugs for each of the user’s goals, or an array of goal hashes if diff_since or associations is sent.
  • deleted_goals (array): An array of hashes, each with one key/value pair for the id of the deleted goal. Only returned if diff_since is sent.

Get information about a user

     GET /users/u.json

Retrieves information and a list of goal names for the user with username u.

Since appending an access_token to the request uniquely identifies a user, you can alternatively make the request to /users/me.json (without the username).

Parameters

  • [goals_filter] (string): One of {all, frontburner, backburner}. Default: all, which returns an unfiltered list of all goals.
    Send frontburner if you want the list of goals the user has marked as frontburner goals (those which appear above the fold in the web interface), or backburner for just the below-the-fold goals.

  • [associations] (boolean): Convenience method to fetch all information about a user. Please use sparingly and see also the diff_since parameter. Default: false
    Send true if you want to receive all of the user’s goal and datapoints as attributes of the user object.

  • [diff_since] (number): Unix timestamp in seconds. Default: null, which will return all goals and datapoints
    Send a Unix timestamp to receive a filtered list of the user’s goals and datapoints. Only goals and datapoints that have been created or updated since the timestamp will be returned. Sending diff_since implies that you want the user’s associations, so you don’t need to send both.

  • [skinny] (boolean): Convenience method to only get a subset of goal attributes and the most recent datapoint for the goal. Default: false, which will return all goal attributes and all datapoints created or updated since diff_since.
    skinny must be sent along with diff_since. If diff_since is not present, skinny is ignored. Some goal attributes, as well as fetching all datapoints, can take some additional time to compute on the server side, so you can send skinny if you only need the latest datapoint and the following subset of attributes:

slug, title, goalval, rate, goaldate, graph_url, thumb_url, goal_type, losedate, id, ephem, queued, panic, updated_at, burner, yaw, runits, lane, frozen, won, lost

Instead of a datapoints attribute, sending skinny will replace that attribute with a last_datapoint attribute. Its value is a Datapoint hash.

  • [datapoints_count] (number): number of datapoints. Default: null, which will return all goals and datapoints
    Send a number n to only recieve the n most recently added datapoints, sorted by updated_at. Note that the most recently added datapoint could have been a datapoint whose timestamp is well in the past and therefore before other datapoints in that respect. For example, my datapoints might look like:
    12 1
    14 1
    15 1
    16 1

If I go back and realize that I forgot to enter data on the 13th, the datapoint for the 13th will be sorted ahead of the one on the 16th:
12 1
14 1
15 1
16 1
13 1

Returns

A User object.

Examples


  GET /api/v1/users/alice.json?goals_filter=frontburner

  { "username": "alice",
    "timezone": "America/Los_Angeles",
    "updated_at": 1343449880,                       
    "goals": ["gmailzero", "weight"] }

Use the updated_at field to be a good Beeminder API citizen and avoid unnecessary requests for goals and datapoints. Any updates to a user, their goals, or any datapoints on any of their goals will cause this field to be updated to the current unix timestamp. If you store the returned value and, on your next call to this endpoint, the value is the same, there’s no need to make requests to other endpoints.

Checking the timestamp is an order of magnitude faster than retrieving all the data, so it’s definitely wise to use this approach.


  GET /api/v1/users/alice.json?diff_since=1352561989

  { "username": "alice",
    "timezone": "America/Los_Angeles",
    "updated_at": 1343449880,                       
    "goals": [ {"slug": "weight", ..., 
               "datapoints": [{"timestamp": 1325523600,    
                    "value": 70.45,            
                    "comment": "blah blah",     
                    "id": "4f9dd9fd86f22478d3"}, 
                   {"timestamp": 1325610000,
                    "value": 70.85,
                    "comment": "blah blah", 
                    "id": "5f9d79fd86f33468d4"}], 
               "title": "Weight Loss", ...}, 
               { another goal }, ... ],
    "deleted_goals": [{ "id": "519279fd86f33468ne"}, ... ] 
}

Back to top

Goal Resource

A Goal object includes the everything about a specific goal for a specific user, including the target value and date, the steepness of the yellow brick road, the graph image, and various settings for the goal.

Attributes

  • slug (string): The final part of the URL of the goal, used as an identifier. E.g, if user “alice” has a goal at beeminder.com/alice/weight then the goal’s slug is “weight”.
  • updated_at (number): Unix timestamp of the last time this goal was updated.
  • burner (string): One of frontburner, backburner. Indicates whether the goal is on the “frontburner” for the user in their gallery or whether the goal has been relegated to the “backburner” (below the fold on the web interface).
  • title (string): The title that the user specified for the goal. E.g., “Weight Loss”.
  • goaldate (number): Unix timestamp (in seconds) of the goal date.
  • goalval (number): Goal value — the number the yellow brick road will eventually reach. E.g., 70 kilograms.
  • rate (number): The slope of the (final section of the) yellow brick road.
  • graph_url (string): URL for the goal’s graph image. E.g., “http://static.beeminder.com/alice/weight.png”.
  • thumb_url (string): URL for the goal’s graph thumbnail image. E.g., “http://static.beeminder.com/alice/weight-thumb.png”.
  • autodata (string): The name of automatic data source, if this goal has one. Will be the empty string for manual goals.
  • goal_type (string): One of the following symbols:
    • hustler: Do More
    • biker: Odometer
    • fatloser: Weight loss
    • gainer: Gain Weight
    • inboxer: Inbox Fewer
    • drinker: Do Less
    • custom: Full access to the underlying goal parameters
  • losedate (number): Unix timestamp of derailment. When you’ll be off the road if nothing is reported.
  • panic (number): Panic threshold. How long before derailment to panic. Default: 54000 (15 hours).
  • queued (boolean): Whether the graph is currently being updated to reflect new data.
  • ephem (boolean): Whether the graph was created in test mode. (Test mode goals are periodically garbage-collected.)
  • secret (boolean): Whether you have to be signed in as owner of the goal to view it. Default: false.
  • datapublic (boolean): Whether you have to be signed in as the owner of the goal to view the datapoints. Default: false.
  • datapoints (array of Datapoints): The datapoints for this goal.
  • numpts (number): Number of datapoints.
  • pledge (number): Amount pledged (USD) on the goal.
  • initday (number): Unix timestamp (in seconds) of the start of the yellow brick road.
  • initval (number): The y-value of the start of the yellow brick road.
  • curday (number): Unix timestamp (in seconds) of the end of the yellow brick road, i.e., the most recent (inferred) datapoint.
  • curval (number): The value of the most recent datapoint.
  • lastday (number): Unix timestamp (in seconds) of the last (explicitly entered) datapoint.
  • runits (string): Rate units. One of y, m, w, d, h indicating that the rate of the yellow brick road is yearly, monthly, weekly, daily, or hourly.
  • yaw (number): Good side of the road. I.e., the side of the road (+1/-1 = above/below) that makes you say “yay”.
  • dir (number): Direction the road is sloping, usually the same as yaw.
  • lane (number): Where you are with respect to the yellow brick road (2 or more = above the road, 1 = top lane, -1 = bottom lane, -2 or less = below the road).
  • mathishard (array of 3 numbers): The goaldate, goalval, and rate — all filled in. (You specify 2 out of 3 and can check this if you want Beeminder to do the math for you on inferring the third one.)
  • headsum (string): Summary of where you are with respect to the yellow brick road, e.g., “Right on track in the top lane”.
  • limsum (string): Summary of what you need to do to eke by, e.g., “+2 within 1 day”.
  • exprd (boolean): Interpret rate as fractional, not absolute, change.
  • kyoom (boolean): Cumulative; plot values as the sum of all those entered so far.
  • odom (boolean): Treat zeros as accidental odometer resets.
  • edgy (boolean): Put the initial point on the road edge instead of centerline.
  • noisy (boolean): Compute road width based on data, not just road rate.
  • aggday (string): How to aggregate points on the same day, eg, min/max/mean.
  • steppy (boolean): Join dots with purple steppy-style line.
  • rosy (boolean): Show the rose-colored dots and connecting line.
  • movingav (boolean): Show moving average line superimposed on the data.
  • aura (boolean): Show turquoise swath, aka blue-green aura.
  • frozen (boolean): Whether the goal is currently frozen and therefore must be restarted before continuing to accept data.
  • won (boolean): Whether the goal has been successfully completed
  • lost (boolean): Whether the goal is currently off track
  • contract (dictionary): Dictionary with two attributes. amount is the amount at risk on the contract, and stepdown_at is a Unix timestamp of when the contract is scheduled to revert to the next lowest pledge amount. null indicates that it is not scheduled to revert.
  • road (array): Array of tuples that can be used to construct the Yellow Brick Road. This field is also known as the road matrix. Each tuple specifies 2 out of 3 of [time, goal, rate]. To construct the road, start with a known starting point (time, value) and then each row of the road matrix specifies 2 out of 3 of {t,v,r} which gives the segment ending at time t. You can walk forward filling in the missing 1-out-of-3 from the (time, value) in the previous row.
  • delta_text (string): The text that describes how far the goal is from each lane of the road - the same as appears to the upper right of a goal’s graph. If the goal is on the good side of a given lane, the ✔ character will appear.

The goal types are shorthand for a collection of settings of more fundamental goal attributes. Note that changing the goal type of an already-created goal has no effect on those fundamental goal attributes. The following table lists what those attributes are.

hustler biker fatloser gainer inboxer drinker
yaw 1 1 -1 1 -1 -1
dir 1 1 -1 1 -1 1
exprd false false false false false false
kyoom true false false false false true
odom false true false false false false
edgy false false false false false true
noisy false false true true false false
aggday “sum” “last” “min” “last” “min” “sum”
steppy true true false false true true
rosy false false true true false false
movingav false false true true false false
aura false false true true false false

There are four broad, theoretical categories that goals fall into, defined by dir and yaw:

PHAT = dir -1 & yaw -1 = "go down, like weightloss or gmailzero"
MOAR = dir +1 & yaw +1 = "go up, like work out more"
WEEN = dir +1 & yaw -1 = "go up less, like quit smoking"
RASH = dir -1 & yaw +1 = "go down less, ie, rationing, eg, bmndr.com/d/contacts"

The dir parameter is mostly just for the above categorization, but is used specifically in the following ways:

  1. Where to draw the watermarks (amount pledged and number of safe days)
  2. How to phrase things like “bare min of +123 in 4 days” and the status line (also used in bot email subjects)
  3. Which direction is the optimistic one for the rosy dots algorithm

If you just want the dot color, here’s how to infer it from lane and yaw:

  • lane*yaw >= -1: on the road or on the good side of it (blue or green)
  • lane*yaw > 1: good side of the road (green dot)
  • lane*yaw == 1: right lane (blue dot)
  • lane*yaw == -1: wrong lane (orange dot)
  • lane*yaw <= -2: emergency day or derailed (red dot)

Finally, the way to tell if a goal has finished successfully is now >= goaldate && goaldate < losedate. That is, you win if you hit the goal date before hitting losedate. You don’t have to actually reach the goal value — staying on the yellow brick road till the end suffices.

Get information about a goal

     GET /users/u/goals/g.json

Gets goal details for user u’s goal g — beeminder.com/u/g.

Parameters

  • [datapoints] (boolean): Whether to to send the goal’s datapoints in the response. Default: false.

Returns

A Goal object, possibly without the datapoints attribute.

Examples


  GET /api/v1/users/alice/goals/weight.json?datapoints=true

  { "slug": "weight",               
    "title": "Weight Loss",         
    "goaldate": 1358524800,         
    "goalval": 166,                 
    "rate": null,                   
    "graph_url": "http://static.beeminder.com/alice+weight.png",
    "thumb_url": "http://static.beeminder.com/alice+weight-thumb.png",    
    "goal_type": "fatloser",            
    "losedate": 1358524800,        
    "panic": 54000,                 
    "queued": false,                
    "updated_at": 1337479214,       
    "datapoints": [{"timestamp": 1325523600,    
                    "value": 70.45,            
                    "comment": "blah blah",     
                    "id": "4f9dd9fd86f22478d3"}, 
                   {"timestamp": 1325610000,
                    "value": 70.85,
                    "comment": "blah blah",
                    "id": "5f9d79fd86f33468d4"}]}

Get all goals for a user

     GET /users/u/goals.json

Get user u’s list of goals.

Parameters

Returns

A list of Goal objects for the user.

Examples


  GET /api/v1/users/alice/goals.json?filter=frontburner

  [ 
    { "slug": "gmailzero",
      "title": "Inbox Zero",
      "goal_type": "inboxer",
      "graph_url": "http://static.beeminder.com/alice+gmailzero.png",
      "thumb_url": "http://static.beeminder.com/alice+weight-thumb.png",
      "panic":54000,
      "losedate": 1347519599,
      "goaldate": 0,
      "goalval": 25.0, 
      "rate": -0.5,
      "updated_at": 1345774578,
      "queued": false },
    { "slug": "greengoose-me",
      "title": "Never stop moving",
      "goal_type": "biker",
      "graph_url": "http://static.beeminder.com/alice+greengoose-me.png",
      "thumb_url": "http://static.beeminder.com/alice+greengoose-thumb.png",
      "panic": 86400,
      "losedate": 1346482799,
      "goaldate": 1349582400,
      "goalval": null,
      "rate": 8.0,
      "updated_at": 1345771188,
      "queued": false } 
  ]

Create a goal for a user

     POST /users/u/goals.json

Create a new goal for user u.

Parameters

  • slug (string)
  • title (string)
  • goal_type (string)
  • goaldate (number or null)
  • goalval (number or null)
  • rate (number or null)
  • initval (number): Initial value for today’s date. Default: 0.
  • [ephem] (boolean)
  • [panic] (number)
  • [secret] (boolean)
  • [datapublic] (boolean)
  • dryrun (boolean). Pass this to test the endpoint without actually creating a goal. Defaults to false.

Exactly two out of three of goaldate, goalval, and rate are required.

Returns

The newly created Goal object.

Examples


  POST /api/v1/users/alice/goals.json?slug=exercise&title=Work+Out+More&goal_type=hustler&goaldate=1400000000&rate=5&goalval=null&ephem=false

  { "slug": "exercise",
    "title": "Work Out More",
    "goal_type": "hustler",
    "graph_url": "http://static.beeminder.com/alice+exercise.png",
    "thumb_url": "http://static.beeminder.com/alice+exercise-thumb.png",
    "panic": 54000,
    "losedate": 1447519599,
    "goaldate": 1400000000,
    "goalval": null, 
    "rate": 5,
    "updated_at": 1345774578,
    "queued": false }

One of the three fields goaldate, goalval, and rate will return a null value. This indicates that the value is calculated based on the other two fields, as selected by the user.

Update a goal for a user

     PUT /users/u/goals/g.json

Update user u’s goal g. This is similar to the call to create a new goal, but the goal type (goal_type) cannot be changed. To change any of {goaldate, goalval, rate} use the dial_road call below.

Parameters

  • [slug] (string)
  • [title] (string)
  • [ephem] (boolean): This can be changed from true to false but not vice versa.
  • [panic] (number)
  • [secret] (boolean)
  • [datapublic] (boolean)

Returns

The updated Goal object.

Examples


  PUT /api/v1/users/alice/goals.json?slug=exercise&title=Work+Out+Even+More&panic=3600

  { "slug": "exercise",
    "title": "Work Out Even More",
    "goal_type": "hustler",
    "graph_url": "http://static.beeminder.com/alice+exercise.png",
    "thumb_url": "http://static.beeminder.com/alice+exercise-thumb.png",
    "panic": 3600,
    "losedate": 1447519599,
    "goaldate": 1400000000,
    "goalval": null, 
    "rate": 5,
    "updated_at": 1345774578,
    "queued": false }

Force a fetch of autodata and graph refresh

     GET /users/u/goals/g/refresh_graph.json

Analagous to the refresh button on the goal page. Forces a refetch of autodata for goals with automatic data sources. Refreshes the graph image regardless. **Please be extremely conservative with this endpoint!

Parameters

None.

Returns

This is an asynchronous operation, so this endpoint simply returns true if the goal was queued and false if not. It is up to you to watch for an updated graph image.

Examples


  POST /api/v1/users/alice/goals/weight/refresh_graph.json

  true

Update a yellow brick road

     POST /users/u/goals/g/dial_road.json

Change the slope of the yellow brick road (starting after the one-week Akrasia Horizon) for beeminder.com/u/g.

Parameters

  • rate (number or null)
  • goaldate (number or null)
  • goalval (number or null)

Exactly two of goaldate, goalval, and rate should be specified — setting two implies the third.

Returns

The updated Goal object.

Examples


  POST /api/v1/users/alice/goals/weight/dial_road.json?rate=-0.5&goalval=166&goaldate=null

  { "slug": "weight",                       
    "title": "Weight Loss",                 
    "goal_type": "fatloser",                    
    "graph_url": "http://static.beeminder.com/alice+weight.png",
    "thumb_url": "http://static.beeminder.com/alice+weight-thumb.png",
    "goaldate": null,                 
    "goalval": 166,                         
    "rate": -0.5,                           
    "losedate": 1358524800 }

Short circuit a goal’s pledge

POST /users/u/goals/g/shortcircuit.json

Increase the goal’s pledge level and charge the user the amount of the current pledge.

Parameters

None

Returns

The updated Goal object.

Step down a goal’s pledge

POST /users/u/goals/g/stepdown.json

Decrease the goal’s pledge level subject to the akrasia horizon, i.e., not immediately. After a successful request the goal will have a countdown to when it will revert to the lower pledge level.

Parameters

None

Returns

The updated Goal object.

Cancel a scheduled step down

POST /users/u/goals/g/cancel_stepdown.json

Cancel a pending stepdown of a goal’s pledge. The pledge will remain at the current amount.

Parameters

None

Returns

The updated Goal object.

Back to top

Datapoint Resource

A Datapoint consists of a timestamp and a value, an optional comment, and meta information. A Datapoint belongs to a Goal, which has many Datapoints.

Attributes

  • timestamp (number): The unix time (in seconds) of the datapoint.
  • value (number): The value, e.g., how much you weighed on the day indicated by the timestamp.
  • comment (string): An optional comment about the datapoint.
  • id (string): A unique ID, used to identify a datapoint when deleting or editing it.
  • updated_at (number): The unix time that this datapoint was entered or last updated.
  • requestid (string): If a datapoint was created via the API and this parameter was included, it will be echoed back.

Get all the datapoints

     GET /users/u/goals/g/datapoints.json

Get the list of datapoints for user u’s goal g — beeminder.com/u/g.

Parameters

None.

Returns

The list of Datapoint objects.

Examples


  GET /api/v1/users/alice/goals/weight/datapoints.json

  [{"id":"abc123", "timestamp":1234567890, "value":1.1, "comment":"", "updated_at":1234567890, "requestid":"abcd182475923"}, 
   {"id":"abc124", "timestamp":1234567891, "value":1.2, "comment":"", "updated_at":1234567891, "requestid":"abcd182475924"}]

Create a datapoint

     POST /users/u/goals/g/datapoints.json

Add a new datapoint to user u’s goal g — beeminder.com/u/g.

Parameters

  • [timestamp] (number). Default: now.
  • value (number)
  • [comment] (string)
  • [sendmail] (boolean): Indicates whether to email the user when the graph has updated with the new datapoint. Default: false.
  • [requestid] (string): Alphanumeric string to uniquely identify this datapoint. Clients can use this to verify that Beeminder received a datapoint (important for clients with spotty connectivity). Using requestids also means clients can safely resend datapoints without accidentally creating duplicates. If there is already a datapoint in the database that was created by the same client sending the same requestid, subsequent requests will be ignored. NB: Must contain only alphanumeric characters or it will be ignored.

Returns

The updated Datapoint object.

Examples


  POST /api/v1/users/alice/goals/weight/datapoints.json?timestamp=1325523600&value=130.1&comment=sweat+a+lot+today

  { "timestamp": 1325523600,            
    "value": 130.1,                             
    "comment": "sweat a lot today",   
    "id": "4f9dd9fd86f22478d3000008",
    "requestid":"abcd182475925"}

Create multiple datapoints

     POST /users/u/goals/g/datapoints/create_all.json

Create multiple new datapoints for beeminder.com/u/g.

Parameters

  • datapoints (array of Datapoints): Each must include timestamp, value, and comment, with requestid optional.
  • [sendmail] (boolean): See above. Default: false.

Returns

The list of created Datapoints.

Examples


  POST /api/v1/users/alice/goals/weight/datapoints/create_all.json?datapoints=[{"timestamp":1343577600,"value":220.6,"comment":"blah+blah", "requestid":"abcd182475929"},\
                                             {"timestamp":1343491200,"value":220.7, "requestid":"abcd182475930"}]

  [ { "id": "5016fa9adad11576ad00000f", 
      "timestamp": 1343577600, 
      "value": 220.6, 
      "comment": "blah blah", 
      "updated_at": 1343577600,
      "requestid":"abcd182475923"}, 
    { "id": "5016fa9bdad11576ad000010", 
      "timestamp": 1343491200, 
      "value": 220.7, 
      "comment": "", 
      "updated_at": 1343491200,
      "requestid":"abcd182475923" } ]

Update a datapoint

     PUT /users/u/goals/g/datapoints/id.json

Update the datapoint with ID id for user u’s goal g (beeminder.com/u/g).

Parameters

  • [timestamp] (number)
  • [value] (number)
  • [comment] (string)

Returns

The updated Datapoint object.

Examples


  PUT /api/v1/users/alice/goals/weight/datapoints/5016fa9adad11576ad00000f.json&comment=a+real+comment

  { "id": "5016fa9adad11576ad00000f", 
    "value": 220.6, 
    "comment": "a real comment", 
    "timestamp": 1343577600, 
    "updated_at": 1343577609 }

Delete a datapoint

     DELETE /users/u/goals/g/datapoints/id.json

Delete the datapoint with ID id for user u’s goal g (beeminder.com/u/g).

Parameters

None.

Returns

The deleted Datapoint object.

Examples


  DELETE /api/v1/users/alice/goals/weight/datapoints/5016fa9adad11576ad00000f.json

  { "id": "5016fa9adad11576ad00000f", 
    "value": 220.6, 
    "comment": "a real comment", 
    "timestamp": 1343577600, 
    "updated_at": 1343577609 }

Back to top

Charge Resource

Beeminder provides an endpoint to charge an arbitrary amount to a Beeminder user. The user is inferred from the access_token or auth_token provided. A Charge object has the following attributes:

Attributes

  • amount (number): The amount to charge the user, in US dollars.
  • note (string): An explanation of why the charge was made, or null if none was provided.
  • username (string): The Beeminder username of the user being charged.

Create a charge

     POST /charges

Create a charge of a given amount and optionally add a note.

Parameters

  • amount (number): The amount to charge the user, in US dollars.
  • [note] (string): An explanation of why the charge was made.
  • [dryrun] (string): If passed, the Charge is not actually created, but the JSON for it is returned as if it were. Default: false.

Returns

The Charge object, or a dictionary with the error message(s) if the request was not successful.

Example


  POST /api/v1/charges.json?amount=1&note=Hello%20Charges

  { "id": "5016fa9adad11576ad00000f", 
    "amount": 1, 
    "note": "Hello Charges", 
    "username": "alice" }

Back to top