Public API FAQ

What are the session states it goes through? How to find out how long a session has been in a particular state?

In general, the Public API GET /api/v1/Sessions/{id} is used to find out information about a session, it also contains all the information about the change of the session state and the time it has been in each state. Additional information is also provided by the GET /api/v1/Sessions/{id}/routingHistory

Duration of selected states and phases:

  • CREATED (from session creation to start of routing):

 Common.RoutingTimeLine[activityType="RoutingRequestCreated"].First().timestamp - Sessions.SessionModel.created
  • IN_QUEUE (from the start of routing after the first suitable operator is selected):

 Common.RoutingTimeLine[activityType="AssignedToOperator"].First().timestamp - Common.RoutingTimeLine[activityType="RoutingRequestCreated"].First().timestamp
  • WAITING (from when the first suitable operator is selected to when the session is accepted):

 Common.RoutingTimeLine[activityType="AcceptedByOperator"].First().timestamp - Common.RoutingTimeLine[activityType="AssignedToOperator"].First().timestamp
  • BCW (before call work; od přijetí sezení po spojení s klientem):

 Sessions.SessionModel.guestJoined - Sessions.SessionModel.started (only if the result is positive)
  • ACTIVE (for the duration of the two-way communication):

 Sessions.SessionModel.length
  • ACW (after call work; from the end of two-way communication after the last operator has closed the session):

 Sessions.SessionModel.operators.Max(concluded) - Sessions.SessionModel.operators.Max(left)
  • The time in the queue of a specific operator with userId = X:

 Common.RoutingTimeLine[activityType="AcceptedByOperator"].First().timestamp - Common.RoutingTimeLine[activityType="AssignedToOperator" & operator.userId=X].First().timestamp
  • The ACW time of the specific operator with userId=X:

 Sessions.SessionModel.operators[userId=X].concluded - Sessions.SessionModel.operators[userId=X].left
  • Ring time:

 Sessions.SessionModel.guestJoined - Sessions.SessionModel.created (neplatí u náhledové kampaně)
  • The time from the connection to the PBX to the connection to the operator:

 Sessions.SessionModel.waited

Some session types (session sources) do not go through all states, but some states skip.

Explanation of some items in the response to GET /api/v1/Sessions/{id}

How to download recordings and files from the sessions?

You can get the address of the file from e.g.

Sessions.SessionModel.recordings.downloadUrl

or

Sessions.SessionModel.activities.file.downloadUrl

You can get the file from this address in the same way as you communicate with Public Api, i.e. by adding Authorization to the GET request header (see Authentication section).

Last updated