Get History of Agents Available for Service

Prev Next
Get
/api/v1/livechat/analytics/agents/available-for-service-history
Premium tag

Return the list of agents and their available time for the provided time frame. Permission required: view-livechat-manager

Header parameters
X-Auth-Token
stringRequired

The authToken of the authenticated user.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired

The userId of the authenticated user.

ExamplerbAXPnMktTFbNpwtJ
Query parameters
start
stringRequired

The start date.

Example2020-09-10T23:59:22.345Z
end
stringRequired

The end date.

Example2020-09-09T00:11:22.345Z
fullReport
boolean

If set to true, it shares the service history which will contain more granular data such as the time of the day the agent was available.

ExampleTrue
offset
integer

Number of items to "skip" in the query, i.e. requests return count items, skipping the first offset items. Refer to the official documentation to learn more.

Example50
count
integer

The number of items to return. Refer to the official documentation to learn more.

Example25
Responses
200

OK

Success Example
{
  "agents": [
    {
      "serviceHistory": [
        {
          "startedAt": "2021-11-24T08:35:49.058Z",
          "stoppedAt": "2021-11-24T08:41:32.721Z"
        },
        {
          "startedAt": "2021-11-24T08:51:15.623Z",
          "stoppedAt": "2021-11-24T08:53:59.707Z"
        },
        {
          "startedAt": "2021-11-24T08:55:45.128Z",
          "stoppedAt": "2021-11-24T08:55:45.214Z"
        },
        {
          "startedAt": "2021-11-24T16:56:35.486Z",
          "stoppedAt": "2021-11-24T17:05:56.611Z"
        },
        {
          "startedAt": "2021-11-24T17:20:26.066Z",
          "stoppedAt": "2021-11-24T18:29:59.000Z"
        }
      ],
      "availableTimeInSeconds": 2115334,
      "username": "doe.john"
    },
    {
      "serviceHistory": [
        {
          "startedAt": "2022-02-06T09:45:26.476Z",
          "stoppedAt": "2022-02-06T09:45:27.499Z"
        },
        {
          "startedAt": "2022-02-06T09:45:28.083Z",
          "stoppedAt": "2022-02-06T09:45:28.663Z"
        },
        {
          "startedAt": "2022-02-06T09:45:29.117Z",
          "stoppedAt": "2022-02-06T09:45:29.672Z"
        },
        {
          "startedAt": "2022-02-06T09:45:30.129Z",
          "stoppedAt": "2022-02-06T09:45:30.534Z"
        },
        {
          "startedAt": "2022-02-06T09:45:30.923Z",
          "stoppedAt": "2022-02-06T09:45:31.714Z"
        },
        {
          "startedAt": "2022-02-06T09:45:39.037Z",
          "stoppedAt": "2022-02-06T09:45:41.680Z"
        }
      ],
      "availableTimeInSeconds": 7586,
      "username": "white.chris"
    },
    {
      "serviceHistory": [
        {
          "startedAt": "2021-12-27T13:25:44.459Z",
          "stoppedAt": "2021-12-27T13:27:11.208Z"
        }
      ],
      "availableTimeInSeconds": 1508,
      "username": "max.yui"
    }
  ],
  "count": 3,
  "offset": 0,
  "total": 3,
  "success": true
}
Expand All
object
agents
Array of object
object
serviceHistory
Array of object
object
startedAt
string
stoppedAt
string
availableTimeInSeconds
integer
username
string
count
integer
offset
integer
total
integer
success
boolean
400

Bad Request

Example 1
{
  "success": false,
  "error": "must have required property 'start' [invalid-params]",
  "errorType": "invalid-params"
}
Example 2
{
  "success": false,
  "error": "The \"start\" query parameter must be a valid date."
}
Example 3
{
  "success": false,
  "error": "must have required property 'end' [invalid-params]",
  "errorType": "invalid-params"
}
Example 4
{
  "success": false,
  "error": "The \"end\" query parameter must be a valid date."
}
object
success
boolean
error
string
errorType
string
401

Unauthorized

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

Forbidden

Permission Error
{
  "success": false,
  "error": "User does not have the permissions required for this action [error-unauthorized]"
}
Unauthorized
{
  "success": false,
  "error": "unauthorized"
}
object
success
boolean
error
string
Tags