Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The GET /agent-activities endpoint gets information about agents’ activities. This information includes the agents’ presence, workload, and interaction activities. Use this endpoint for a full picture of an agent’s activity.

...

Info

If you plan to poll this endpoint, we recommend that you set start to the value returned in the upTo parameter in the previous request’s response. For more details, see the FAQ page FAQ (Insights Stats API).

end

TypeRequiredExample
DateFalse2019-12-19T15:47:39.825Z

The end date and time of the search window. Use ISO 8601 format. Default The default is now.

Info

Max request window
Request time windows are limited to 31 days for endpoints. If your request exceeds 31 days, the response will contain a HTTP/1.1 400 status code with the following message:

Code Block
languagejs
themeMidnight
{
	"message":"Request window size limit exceeded 31 days"
}


...

Determines whether to include activities that started, started or , ended, or were processed within the specified time period.

...

If you plan to poll this endpoint then we recommend specifying Processed. Using Processed removes the need for any offset and ensures that you receive all data. Note , that using the StartedOrEnded or Processed values can result in duplicate items being returned across search windows.

...

Specify an agent ID to limit the response to include only activities relating to the specified agent. agentId is the agent ID provided when creating an agent in the Vonage Contact Center (VCC) Admin Portal.

By default, all agents are returned.

type

...

  • Presence. The response includes only agent presence activities.
  • Interaction. The response includes only agent interaction activities.
  • Workload. The response includes only agent workload activities.

By default, all types of agent activities are returned.

...

Code Block
languagejs
themeMidnight
{
  "meta": {
    "page": 1,
    "count": 6,
    "pageCount": 1,
    "totalCount": 6
  },
  "items": [
    {
      "agentId": "01",
      "type": "Presence",
      "category": "LoggedOut",
      "name": "Logged Out",
      "eligibleForRouting": false,
      "start": "2019-12-19T15:47:07.077Z",
      "status": null,
      "duration": 9523,
      "reason": null,
      "interaction": null,
      "channel": null,
      "workload": null
    },
    {
      "agentId": "01",
      "type": "Presence",
      "category": "Ready",
      "name": "Ready",
      "eligibleForRouting": true,
      "start": "2019-12-19T15:47:16.600Z",
      "status": null,
      "duration": null,
      "reason": null,
      "interaction": null,
      "channel": null,
      "workload": null
    },
    {
      "agentId": "01",
      "type": "Workload",
      "category": null,
      "name": null,
      "eligibleForRouting": null,
      "start": "2019-12-19T15:47:30.246Z",
      "status": null,
      "duration": 86354,
      "reason": null,
      "interaction": null,
      "channel": null,
      "workload": {
        "calls": 1,
        "semiLive": 0,
        "nonLive": 0
      }
    },
    {
      "agentId": "01",
      "type": "Interaction",
      "category": "Ringing",
      "name": null,
      "eligibleForRouting": null,
      "start": "2019-12-19T15:47:31.289Z",
      "status": "Completed",
      "duration": 4547,
      "reason": null,
      "interaction": {
        "guid": "016f1c6b-9766-498c-9756-30afb0354d5b",
        "medium": "Phone",
        "mediumManager": "VCC",
        "direction": "Inbound"
      },
      "channel": {
        "guid": null
      },
      "workload": null
    },
    {
      "agentId": "01",
      "type": "Interaction",
      "category": "Connected",
      "name": null,
      "eligibleForRouting": null,
      "start": "2019-12-19T15:47:35.836Z",
      "status": "Completed",
      "duration": 80764,
      "reason": null,
      "interaction": {
        "guid": "016f1c6b-9766-498c-9756-30afb0354d5b",
        "medium": "Phone",
        "mediumManager": "VCC",
        "direction": "Inbound"
      },
      "channel": {
        "guid": null
      },
      "workload": null
    },
    {
      "agentId": "01",
      "type": "Interaction",
      "category": "Wrap",
      "name": null,
      "eligibleForRouting": null,
      "start": "2019-12-19T15:48:56.600Z",
      "status": "Completed",
      "duration": 3912,
      "reason": null,
      "interaction": {
        "guid": "016f1c6b-9766-498c-9756-30afb0354d5b",
        "medium": "Phone",
        "mediumManager": "VCC",
        "direction": "Inbound"
      },
      "channel": {
        "guid": null
      },
      "workload": null
    }
  ],
  "upTo": "2019-12-19T15:49:39.389Z"
}

The response responses for the three activity types are described below.

...

The agent can be engaged in multiple activities on different interactions at the same time , but in only in one activity for each interaction. For example, the agent could be in a Wrap category for a call, whilst in a Connected category for a case.

...

An agent has a single workload state at any one time. When an agent begins or finishes work on an interaction, their previous workload activity ends and a new workload activity begins. For example, if an agent was working on a live interaction (call) they would have a workload activity with "calls": 1. "semiLive": 0 and "nonLive": 0. When they complete that call, their new workload activity would present a workload of "calls": 0, "semiLive": 0 and "nonLive": 0.

...

A new workload activity will be returned each time an agent either starts or finishes working on an interaction, or changes presence.

Example workload activity

...

  • agentId. The agent’s ID, as defined in VCC during agent creation.
  • type. The type of activity. type will always be Workload for a workload activity.

  • start. A timestamp which that indicates when the workload activity started. start is a UTC date in ISO 8601 format.

  • duration
    A length of time, in milliseconds, that indicates exactly how long the agent remained in this workload activity. If the activity represents the agent's current workload, duration is null.
  • workload. workload contains a list of all of the agent’s interactions broken down by type.

    • calls. The number of live interactions that the agent is currently handling.
    • semiLive. The number of semi-live interactions that the agent is currently handling.
    • nonLive. The number of non-live interactions that the agent is currently handling.

...