Skip to content

Instantly share code, notes, and snippets.

@nmonga91
Last active July 13, 2017 19:22
Show Gist options
  • Save nmonga91/a3cf5a31c893a5901aecce1c1d8a1ab5 to your computer and use it in GitHub Desktop.
Save nmonga91/a3cf5a31c893a5901aecce1c1d8a1ab5 to your computer and use it in GitHub Desktop.
Budget Function Autocomplete Endpoint

Retrieve budget functions for the autocomplete text box

Route: /api/v2/autocomplete/budget_function/

Method: POST

This route sends a request to the backend to retrieve budget functions matching the specified search text.

Request example

{
	"search_text": "budget",
	"limit": 10
}

Request Parameters Description

  • search_text - required - a string that contains the search term(s) on which to search for the budget functions
  • limit - optional - an integer representing the number of desired entries per budget title type. It can be an integer or a string representation of an integer. Defaults to 10.

Response (JSON)

{
	"results": {
		"budget_function_title": ["Income Security"],
		"budget_subfunction_title": ["Other income security", "Income security for veterans"]
	},
	"counts": {
		"budget_function_title": 1,
		"budget_subfunction_title": 2
	}
}

Errors

Possible HTTP Status Codes:

  • 400 : Missing parameters or limit is not a valid, positive integer
  • 500 : All other errors
{
  "message": "Sample error message"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment