Get Department Listing
Request
GET:/{accountBookId}/department/listing
Request Parameters
Parameter | Description | Type | |
---|---|---|---|
page | Page index of returned records. Each page contains at most 100 records. Using a page index beyond the number of available pages will result in empty result. | number | required |
leafOnly | Leaf only flag. When field value is "true", parent departments will be excluded from the query. | boolean | |
activeOnly | Active only flag. When field value is "true", only active departments will be included in the query. | boolean |
Example Request URL:
Example: Get listing of active departments excluding parent departments in listing records.Parameters:
accountBookId
= 1 page
= 1 leafOnly
= true activeOnly
= true URL:
GET: https://accounting-api.autocountcloud.com/1/department/listing?leafOnly=true&activeOnly=true&page=1
Response
Success Response
Status Code: 200
Response Body
Field | Description | Type |
---|---|---|
data | Response data. | array[Department Listing View Model] |
totalCount | Number of records retrieved. | number |
Example Success Response Body
{
"data": [
{
"DeptNo": "D-0004",
"Description": "Finance department",
"Desc2": "",
"IsActive": true,
"ParentDeptNo": null
},
{
"DeptNo": "D-0001",
"Description": "Sales department",
"Desc2": "",
"IsActive": true,
"ParentDeptNo": null
},
{
"DeptNo": "D-0003",
"Description": "Product decisions department",
"Desc2": "",
"IsActive": true,
"ParentDeptNo": null
}
],
"totalCount": 3
}
Error Response
Response Body
object: Error Response Model
Example Error Response Body
{
"statusCode": 401,
"message": "401 Unauthorized."
}