Next Month api call not working

Hello,

The following API call: 

https://api.youneedabudget.com/v1/budgets/***********/months/2019-10-01/?access_token=*********

returns:

{"error":{"id":"404.2","name":"resource_not_found","detail":"Resource not found"}}

however, this used to work just fine. Please advise. Any help would be appreciated. Thanks. 

10replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  •  I noticed this as well. The next month is listed under the months collection of the budget details, but no longer at the months endpoint. Assuming it's related to the change listed in the 9/3/2019 release notes.

    Previously the /budgets/:id/months and /budgets/:id/months/:id endpoints would sometimes return months outside of the first_month and last_month (the “budget window,” as we call it) of the budget. Well, we fixed that and now the returned data is more of a budget window than a budget sliding glass door.

    Reply Like
    • Jake Moening Thanks for the reply. I'll get this information from the budget details endpoint instead. Thanks again. 

      Reply Like
    • Jaron Lofquist Jake Moening Thanks for the follow up here! We did update some of the API calls this week, but if you find yourself missing something and unable to do something you could previously do let me know--I'd love to make sure we didn't accidentally remove functionality when we were cleaning up the calls! 

      Reply Like
      • Matt T
      • matt.1
      • 1 mth ago
      • Reported - view

      Chrissy I'm not sure if it's something I may have done, but my API script broke related to fetching the next budget month. Example below (I ran this just now in the API explorer):

      Request URL:

      https://api.youneedabudget.com/v1/budgets/last-used/months/2019-10-01

      Response:

      {
        "error": {
          "id": "404.2",
          "name": "resource_not_found",
          "detail": "Resource not found"
        }
      }

      This used to (under a week ago) return the same type of response as the current month:

      Current month response snippet:

      {
        "data": {
          "month": {
            "month": "2019-09-01",
            "note": null,
            "income": 0,
            "categories": []
            ....
      

      I was using this to get my furthest ahead budget month (for me I only ever budget one month ahead) in order to grab the categories and run some additional calculations.

      If there is another endpoint I should use, please let me know!

      Thanks. 🙂

      Reply Like
    • Matt T If you run the 

      https://api.youneedabudget.com/v1/budgets/last-used

      query I'm guessing the last_month value on the budget is "2019-09-01" and not "2019-10-01". According to the latest API change, values that fall beyond that value will return a 404. I'm not sure what YNAB's plan is moving forward; maybe the last_month will be modified to include the last budgeted month or something? Either way some of that October information may still be retrieved from the 'budgets/last-used' endpoint I mentioned above if you dig into that response at 'data.budgets.months[0] ' or something similar.

      {
          "data": {
              "budget": {
                  "name": "TestBudget",
                  "last_modified_on": "2019-09-04T16:20:29+00:00",
                  ...
                  "first_month": "2019-08-01",
                  "last_month": "2019-09-01",
                  "months": [
                      {
                          "month": "2019-10-01",
                          "note": null,
                          "income": 0,
                          "budgeted": 0,
                          "activity": 0,
                          "to_be_budgeted": 0,
                          "age_of_money": 14,
                          "deleted": false,
                          "categories": [
                              {
                                  "id": "f0510e6e-4960-4658-920b-6f100709722d",
      

      That's obviously not an ideal solution long term, but may get your script back up and running in the meantime. Best of luck!

      Reply Like
      • Matt T
      • matt.1
      • 1 mth ago
      • Reported - view

      Nevermind! 😄I see my problem now. Since I didn't actually have anything budgeted yet for October, I can't get that budget month. As soon as I budgeted something for October, I can successfully fetch that month. I just never noticed this because typically I always have something budgeted into the next month. So I just have to update my script to fall back to the current month if nothing is budgeted into the next month.

      Reply Like
      • Matt T
      • matt.1
      • 1 mth ago
      • Reported - view

      Jake Moening Thank you! Your comment helped me realize what was going on.

      Reply Like
    • Matt T No problem!

      Reply Like
    • Chrissy thanks for the response. It would be easier to be able to pull next month's budget data directly rather than download the entire budget and then parse out what I need. 

      Reply Like
  • With the recent change Chrissy and Jake mentioned, we are indeed only providing months between first_month and last_month on the /budgets/:id/months endpoint.

     Jaron Lofquist, I suspect you don't have anything budgeted in October which is why we are now responding with a 404.2.

    I understand and can appreciate  the use case and how it is convenient to look at the next/future month, particularly in relation to the current calendar month, to see if anything is budgeted.  And, to not have to get the budget detail to determine the last_month.  We do calculate through the last_month + 1 so the data is available and it's reasonable to make it available.  I'll work on a change so that the /budget/:id/months endpoint will now include the month following the last_month on the budget.  I think this should help this use case. 

    Reply Like
Like Follow
  • 1 mth agoLast active
  • 10Replies
  • 72Views
  • 5 Following