Get Department Information
    • Dark
      Light
    • PDF

    Get Department Information

    • Dark
      Light
    • PDF

    Article summary

    Get
    /api/v1/livechat/department/{_id}

    Get information about a specific department using the department ID. At least one of the following permissions is required:

    • view-livechat-departments
    • view-l-room

    Changelog

    VersionDescription
    2.2.0Added includeAgents query parameter
    0.42.0Added
    Header parameters
    X-Auth-Token
    stringRequired

    The authToken of the authenticated user.

    ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
    X-User-Id
    stringRequired

    The userId of the authenticated user.

    ExamplerbAXPnMktTFbNpwtJ
    Path parameters
    _id
    stringRequired

    The department ID.

    Query parameters
    includeAgents
    boolean

    If agents should be included in the result. By default, the value is true and the list of agents is returned. The agents field will only be returned if the user has the view-livechat-departments permission.

    ExampleTrue
    Responses
    200

    OK

    Success Example
    {
      "department": {
        "_id": "iTfLCX3qqwKgf5uqg",
        "enabled": false,
        "name": "new from api",
        "description": "creating a department",
        "numAgents": 1,
        "showOnRegistration": true,
        "_updatedAt": "2016-12-13T17:22:19.109Z"
      },
      "agents": [
        {
          "_id": "DDjZbhTF74n3NBuWK",
          "agentId": "SQafHvoFPuB57NmBD",
          "departmentId": "iTfLCX3qqwKgf5uqg",
          "username": "john.doe",
          "count": 0,
          "order": 0,
          "_updatedAt": "2016-12-13T17:22:19.169Z"
        }
      ],
      "success": true
    }
    Expand All
    object
    department
    object
    _id
    string
    enabled
    boolean
    name
    string
    description
    string
    numAgents
    integer
    showOnRegistration
    boolean
    _updatedAt
    string
    agents
    Array of object
    object
    _id
    string
    agentId
    string
    departmentId
    string
    username
    string
    count
    integer
    order
    integer
    _updatedAt
    string
    success
    boolean
    401

    Unauthorized

    Authorization Error
    {
      "status": "error",
      "message": "You must be logged in to do this."
    }
    object
    status
    string
    message
    string
    403

    Forbidden

    Example 1
    {
      "success": false,
      "error": "User does not have the permissions required for this action [error-unauthorized]"
    }
    Example 2
    {
      "success": false,
      "error": "unauthorized"
    }
    object
    success
    boolean
    error
    string

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.