Skip to content

Instantly share code, notes, and snippets.

@russellbodine
Last active June 22, 2017 21:03
Show Gist options
  • Save russellbodine/a084a88665385d2580e57dbddb67df94 to your computer and use it in GitHub Desktop.
Save russellbodine/a084a88665385d2580e57dbddb67df94 to your computer and use it in GitHub Desktop.
Budget authority for agency (v2)

Retrieve agency

Route: /api/v2/financial_balances/agencies/?fiscal_year=2017&funding_agency_id=246

Method: GET

This route sends a request to the backend to retrieve an agency.

PARAMETER

fiscal_year: fiscal year in question funding_agency_id: agency db id

EXAMPLE RESULTS

"results": 
    {
        "budget_authority_amount": "46564455029.68",
        "total_budget_authority_amount: "3860000000.00",
        "obligated_amount": "17839104086.11",
        "outlay_amount": "19368986358.21"
    }

RESULT VARS (all values are returned as STRINGS or NONE)

  • budget_authority_amount: Uses all the AppropriationAccountBalances rows that contain a submission in the fiscal year provided, and have a top tier agency that corisponds to the funding agencies top tier agency. The code sums the AppropriationAccountBalances rows' budget_authority_available_amount_total_cpe var.
  • total_budget_authority_amount: returns the fiscal years total budget athority
  • obligated_amount: Gets AppropriationAccountBalences rows the same as above, but sums thier obligations_incurred_total_by_tas_cpe var
  • outlay_amount: Gets AppropriationAccountBalences rows the same as above, but sums thier gross_outlay_amount_by_tas_cpe var

ERRORS if funding_agency_id does not exist or agency has no corrisponding AppropriationAccountBalances, a response of 'results': {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment