Making a request


To make a API request, authorization token must be attached to headers

  • Sample Call
    curl -H "Content-Type: application/json" -H 'Authorization: Token <auth_token>' -X GET https://< SUBDOMAIN >.agbucket.com/api/1.0/<REQUEST_API/



Organizations, GET


Fetches existing organizations.


URL

  • /api/1.0 /organization/


URL Parameters, Optional:

  • q=[string]
  • show_active=[boolean]    
  • show_inactive =[boolean]


Success Response:

  • Code: 200
  • Response example:
[
    {
        "id": 1,
        "code": "10",
        "name": "Business Line 1",
        "level": 0,
        "active": true
    },
]


Sample Call:

/api/1.0/organization/?show_inactive=false&q=Business




Organizations, PUT (Create)


Creates new organization


URL

  • /api/1.0/node/hierarchy/

Data Params

  • Accepts a single object

        Required:

  • name=[string]
    • Organization name

        Optional:

  • active=[boolean]
    • Is organization active
  • parent=[integer]
    • Parent of this organization(Silverbucket internal id)
  • code=[string]
    • Organization’s code


Sample Call:

  • /api/1.0/node/hierarchy/

Content:

{"name": "Unit 1", "parent": 1, "code": "UnitCode", "active": true}





Organizations, PATCH (Edit)


Update single organization record.


URL

  • /api/1.0/organization/{id}/

URL Params


        Required:

  • id=[integer]
    • Internal organization id

Data Params

  • Updated field(s)


Success Response:

  • Code: 200
  • Response:
{"id":1, "code": "10", "name": "Business unit", "active":true}


Sample Call:

  • /api/1.0/organization/1/


Sample Content:

{"code": "10", "name": "Business Line 10"}