Skip to content

Instantly share code, notes, and snippets.

@shinson
Last active September 11, 2017 17:05
Show Gist options
  • Save shinson/9638d5a2c8fa40dd5949d0e29d3d6e9a to your computer and use it in GitHub Desktop.
Save shinson/9638d5a2c8fa40dd5949d0e29d3d6e9a to your computer and use it in GitHub Desktop.
/federal_account/:federal_account_id/available_object_classes

Rollup of Object Classes for Federal Account

Route:/api/v2/federal_accounts/:federal_account_id/available_object_classes

Method: GET

This route sends a request to the backend to retrieve minor object classes rolled up under major classes filtered by federal account.

Required Parameters

  • federal_account_id: required - an integer representing the federal account id to filter on

Response (JSON)

HTTP Status Code: 200

{
    "results": [
        {
            "id": "20",
            "name": "Contractual services and supplies",
            "minor_object_class": [
                {
                    "id": "220",
                    "name": "Transportation of things"
                },
            ...]
        },
    ...]
}

Response Attributes Description

  • id: Major object class id (Major object class code) Reference for filtering
  • name: Major object class name/label
  • minor_object_class:id: Minor object class id (Minor object class code). Reference for filtering
  • minor_object_class:name: Minor object class name/label

Errors

Possible HTTP Status Codes:

  • 400: Missing Parameter
  • 500: All other errors
@nmonga91
Copy link

nmonga91 commented Sep 7, 2017

Can we update the sample response so that "results" is wrapped in a JSON object as well? so like { "results": ... }

@kevinli-work
Copy link

Can we update the docs to use the correct endpoint: v2/federal_accounts

@shinson
Copy link
Author

shinson commented Sep 11, 2017

  • Update results Json
  • Updated route endpoint

-Updated id fields to string based on Kevin's findings:

 {
            "id": "90",
            "name": "Other",
            "minor_object_class": [
                {
                    "id": "940",
                    "name": "Financial transfers"
                }
            ]
 },
{
            "name": "Other",
            "minor_object_class": [
                {
                    "name": "",
                    "id": 0
                }
            ],
            "id": 0
 }
  • 'Other' major object class code should be "00", with a minor object class code: "000", and minor class code name: ""
  • 'Other' is the major object class name for multiple major class codes

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