Skip to content

Instantly share code, notes, and snippets.

@russellbodine
Last active July 10, 2017 16:18
Show Gist options
  • Select an option

  • Save russellbodine/09dc80f4aacf2ff988a8d01faa8baf2a to your computer and use it in GitHub Desktop.

Select an option

Save russellbodine/09dc80f4aacf2ff988a8d01faa8baf2a to your computer and use it in GitHub Desktop.

Retrieve agency

Route: api/v2/references/agency/:id

Method: GET

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

PARAMETER

id: Database ID

EXAMPLE RESULTS

{'results': {'agency_name': 'tta_name', 
            'active_fy': '2017', 
            'active_fq': '2',
            'outlay_amount': '2.00', 
            'obligated_amount': '2.00',
            'budget_authority_amount': '2.00',
            'current_total_budget_authority_amount': '3860000000.00'}}

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

  • agency_name: Agency name (most important)
  • active_fy: most recent fiscal year data is provided for that agency
  • active_fq: most recent fiscal quarter data is provided for that agency
  • outlay_amount: Agency's outlay amount
  • obligated_amount: Agency's obligated amount
  • budget_authority_amount: Agency total budget authority
  • current_total_budget_authority_amount: Govenment total budget authority for the respective fiscal year

ERRORS

if agency id does not exist or agency has no corrisponding submissions, a response of 'results': {}

if total_budget_authority_amount is not in the db, it returns a vaule of "-1"

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