URL: 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,

  "departments": [
     {
         "id": 1,
         "name": "support",
         "type": {
              "id": 1,
              "name": "Public"
         }
     "is_default": 0,
     "created_at": "2018-11-16 06:43:39",
     "updated_at": "2018-11-16 07:00:46",
     "managers": [
       {
         "id": 1,
         "name": "Demo Admin"
        }
    ]

         "first_page_url":"http:\/\/faveo\/api\/departments-list? page=1",

"from":1,

"last_page":1,

"last_page_url":"http:\/\/faveo\/api\/departments-list?page=1",

"next_page_url":null,

"path":"http:\/\/faveo\/api\/departments-list",

"per_page":10,

"prev_page_url":null,

"to":1,

"total":1

   

}



OR

{

"success":true,

"data":{

        "current_page":1,

  "departments": [
     {
         "id": 2,
         "name": "sales",
         "type": {
              "id": 1,
              "name": "Public"
         }
     "is_default": 0,
     "created_at": "2018-11-16 06:43:39",
     "updated_at": "2018-11-16 07:00:46",
     "managers": []

         "first_page_url":"http:\/\/faveo\/api\/departments-list? page=1",

"from":1,

"last_page":1,

"last_page_url":"http:\/\/faveo\/api\/departments-list?page=1",

"next_page_url":null,

"path":"http:\/\/faveo\/api\/departments-list",

"per_page":10,

"prev_page_url":null,

"to":1,

"total":1

   

}

 

Leave a Reply

Your email address will not be published. Required fields are marked *