Skip to content

Instantly share code, notes, and snippets.

@nmonga91
Last active July 24, 2017 20:39
Show Gist options
  • Save nmonga91/4c758dfabfc89b9089f88781c67c7371 to your computer and use it in GitHub Desktop.
Save nmonga91/4c758dfabfc89b9089f88781c67c7371 to your computer and use it in GitHub Desktop.
Toptier Agency V2 Update

Retrieve all Toptier Agency data

Route: /api/v2/references/toptier_agencies/

Method: GET

This route sends a request to the backend to retrieve all toptier agencies and related, relevant data.

Request example

/api/v2/references/toptier_agencies/?sort=agency_name&order=asc

Query Parameters Description

  • sort - OPTIONAL - Optional parameter indicating what value results should be sorted by. Valid options are any of the keys in the JSON objects in the response. Defaults to agency_name.
  • order - OPTIONAL - Optional parameter indicating what direction results should be sorted by. Valid options include asc for ascending order or desc for descending order. Defaults to asc.

Response (JSON)

{
    "results": [
      {
        'agency_id': 4,
        '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,
        'percentage_of_total_budget_authority': 1.21231
      },
      ...
    ]
}

Response Attributes Description

  • agency_id: Agency ID. Used as a reference for other endpoints for agency related lookups.
  • agency_name: Agency name
  • 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
  • percentage_of_total_budget_authority: budget_authority_amount / currnet_total_budget_amount

Errors

Possible HTTP Status Codes:

  • 400 : Missing parameters
  • 500 : All other errors
{
  "detail": "Sample error message"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment