URL: v3/api/admin/departments-list/
Method: GET
Description : Fetches existing departments and provides search support
Parameters:
| Parameter | Type | Optional/Required | Description |
| search_query | string | Optional | String that is required to be searched. |
| limit | integer | Optional | No. of records to be fetched. |
| sort_order | string | Optional | Records to be ordered in asc or desc. |
| sort_field | string | Optional | Department attribute based on which sorting will be done. |
| page | integer | Optional | Page number |
Success Response :
{
"success": true,
"data": {
"current_page": 1,
"data": [
{
"id": 14,
"name": "Support",
"type": {
"id": 1,
"name": "Public"
},
"is_default": 0,
"form_identifier": "department_14",
"managers": [
{
"id": 5,
"first_name": "Ramesh",
"last_name": "Kumar",
"full_name": "Ramesh Kumar",
"meta_name": "Ramesh Kumar",
"email_verified": false,
"mobile_verified": false,
"pivot": {
"department_id": 14,
"agent_id": 5
}
}
]
},
{
"id": 12,
"name": "Sales",
"type": {
"id": 1,
"name": "Public"
},
"is_default": 0,
"form_identifier": "department_12",
"managers": []
}
],
"first_page_url": "http://localhost/faveo/public/v3/api/admin/departments-list?page=1",
"from": 1,
"last_page": 6,
"last_page_url": "http://localhost/faveo/public/v3/api/admin/departments-list?page=6",
"next_page_url": "http://localhost/faveo/public/v3/api/admin/departments-list?page=2",
"path": "http://localhost/faveo/public/v3/api/admin/departments-list",
"per_page": 2,
"prev_page_url": null,
"to": 2,
"total": 11
}
}