Response Structure

All responses to Interaction API queries are returned as JSON objects. Responses includes attributes and statistics relevant to your interaction.

To provide meaningful context to the data, the JSON object is organized as follows:

  • Interaction—At the root level of the response, customer-related data is provided. Several objects are included at the root level. Each object provides contextual data, as follows:
    • Agent—Includes agent-related data. Each entry provides data from when an agent is allocated until the agent is deallocated in the interaction. There may be multiple agents involved in the interaction. For each time that an agent is allocated, a unique interactionAgentId attribute is created.
    • Queue—Each entry in this object provides queue-related data from when a customer enters a queue until an agent is allocated to their interaction. An interaction may be transferred to another queue, so there may be multiple queues listed. For each queue entry in an interaction, a new interactionQueueId attribute is created.
    • Segment—Each entry in this object provides data about the segments of the customer interaction. Segments can also be known as call legs. Segments are enumerated as follows:
      • Segment 0 starts when the interaction starts. The segment ends when the agent is deallocated. The agent is deallocated when he or she completes the interaction or transfers the interaction. The segment also ends when the interaction is abandoned or canceled. For an interaction that is not transferred and no participants are added, there is only one segment.
      • Segment 1 and subsequent segments start when the first agent transfers the interaction or a participant is added. The segment ends either when the second agent is deallocated, either by concluding the call or transferring the interaction. The segment also ends if interaction is abandoned or canceled.

Understanding Agent IDs in the Segment Object

At least one agent is involved in each segment of an interaction. If that agent transfers the interaction to another agent or adds another agent (add participant), multiple agents are identified in the segment JSON object. Each agent in a segment requires a unique ID.

You can consider agents IDs as identifying the "From Agent" and "To Agent". These terms are not used in the JSON object and only meant to explain the following agent-related IDs:

  • segmentAgentId—The "From Agent. This is the agent responsible for creating this segment. For example, this is the agent that initiated the add-participant or transfer event, or makes an outbound interaction. Segment 0 does not return a segmentAgentId parameter because an interaction-start event, not an agent, created the segment.
  • segmentToAgentId—The "To Agent". This is the agent that accepted the work, either through a transfer or add participant action, for this segment.
    • For inbound interactions, the segmentToAgentId is the UUID of the agent that accepted the transfer invitation, and therefore, is the agent associated with this segment.
    • For outbound interactions, the segmentAgentId is the UUID of the agent that initiated the outbound interaction, and therefore is the agent associated with this segment .The agent that initiated the outbound interaction is also identified as both the “From Agent” (segmentAgentId) and the “To Agent” (segmentToAgentId).

Statistic Definitions

The attributes and statistics can vary from interaction to interaction based on factors such as the channel and actions that take place within the interaction.

For more information on the statistics that are returned, see the Data Dictionary. Statistics are listed by their user-friendly name in the Data Dictionary. To search for the Interaction API name, expand the Data Dictionary and press CTRL + F to open a search box. For more information, see Online Help Search Tips.

What Happens with Parameters that have Null Values

By default, GET requests return only parameters that have a value. If the value is null, the parameter is filtered out of the response. You can run a query to return all parameters, including those with null values by appending ?green=false to your request. See Example: Including Null Values in a Response.