Operations

When the partner application needs the Call Summary and Call Tagging feature to perform an action or send data, it must invoke an Operation on the SDK.

For example, the partner application wants to notify an agent, via the Service Guide zone, that it has received an incoming call. This requires the partner application to invoke the callReceived operation.

Available operations include:

  • ctiInitialized
  • agentStatusUpdated
  • callReceived
  • initiatedCallSession
  • endCallSession
  • callMuted
  • callUnmuted
  • callOnHold
  • callResumed
  • transcriptReceived
  • callWrappedUp
  • loggedOut

To indicate that these operations are targeted towards the Service Guide interface, the operations are added under the "Ui" namespace of the SDK. Below is an example code for invoking an operation:

// SDK loading and initialization code as demonstrated before.

// Finish rest of the CTI specific setup
// initCti(...); //illustration purpose only

// After all initialization is done, notify Service Guide of it
// (Assuming the SDK instance is named "serviceGuideSdk")

serviceGuideSdk.Ui.ctiInitialized();

// This can also be done in some async callback if your setup needs an asynchronous handling
// Assuming getAuthToken is an asynchronous function that returns auth token for a logged in user.

getAuthToken(async (authToken) => {
// assuming CTI vendor has a `ctiSdk` library that provides a client initialization code

await ctiSdk.ApiClient.initialize(authToken); // Another asynchronous processing

// At this point all CTI initialization is done, notify Service Guide.

serviceGuideSdk.Ui.ctiInitialized();
});

...

/* Another example */
// Assuming CTI vendor has below API for subscribing to a client that invokes the provided callback when a customer call is received.

ctiSdk.ApiClient.Interaction.subscribe(async (callData) => {

// Invoke "callReceived" operation on Service Guide SDK's "Ui" module.

    serviceGuideSdk.Ui.callReceived({
        data: {
            phoneNumber: calData.ani,
            callId: callData.id
        }
    });
});

Operation: ctiInitialized

This table provides details of the ctiInitialized operation:

Operation Component Details
Description

This is the first operation the partner application invokes to notify Service Guide that the application is ready to handle CTI functionalities.

It should be invoked after initial setup of the partner application is complete, which includes:

  • Setting up communication channels and websocket connections
  • Initializing various SDKs, including the Service Guide SDK
  • Completing all other initialization code
Payload None
Parameter Description Not Applicable
Notes

Service Guide expects this operation to be called when the partner application is loaded to confirm that it is ready to handle call center operations.

If Service Guide does not receive a response within a predetermined time, it reloads the partner application iFrame.

If the partner application can't be loaded after 3 attempts, Service Guide assumes the Partner Application is down and abandons attempts to load it. Service Guide notifies the agent about the failure to load the partner application.

Operation: agentStatusUpdated

This table provides details of the agentStatusUpdated operation:

Operation Component Details
Description

This operation is used by the partner application to notify Service Guide of the agent's availability to take an incoming call.

The Service Guide displays one of these agent statuses, depending upon the payload when the operation is invoked:

  • Ready
  • Not Ready

When an agent is actively handling a call, the status is Not Ready.

Be aware that the partner application must invoke this operation to notify Service Guide when the agent should be moved to Not Ready status. Depending on the CTI vendor, this could be an explicit notification that the vendor sends to the partner application or it could be done by the partner application in response to when a call is connected.

Payload
{
    data: {
         isAgentReady: boolean
    },

    error: object<{
        isError: boolean, 
        message: string }> (optional)
   }
}
Parameter Description

isAgentReady:

Whether the agent is currently ready to receive calls.

Error Parameter Description

If the Partner Applications receives an error while updating the agent status, it notifies Service Guide about the error by including an "error" object in the payload instead of including a "data" object.

The error object has the following properties:

  • isError: Boolean representing whether or not an error occurred.
  • message: An error code representing the type of error that occured. Possible values:
    • "READY_​STATUS_​UPDATE_​FAILED"
    • "NOT_​READY_​STATUS_​UPDATE_​FAILED"
Notes None

Operation: callReceived

This table provides details of the callReceived operation:

Operation Component Details
Description

When an incoming call is received from the CTI vendor and sent to the partner application, invoke this operation to notify Service Guide about the incoming call.

Payload
{
    data: {
        phoneNumber: string,
        callId: string
   }
}
Parameter Description

phoneNumber:

Incoming customer phone number.

callId:

A unique identifier representing the new incoming call session.

Notes None

Operation: initiatedCallSession

This table provides details of the initiatedCallSession operation:

Operation Component Details
Description

To be invoked when the new call session is established with the customer in response to an incoming call.

Note that the agent will not explicitly accept an incoming call, but must be automatically connected to the call using auto-answer capabilities. Depending upon the CTI vendor, this could be an explicit setting in the CTI backend, or the Partner Application might be required to invoke an explicit vendor API to accept the call when it is received.

Service Guide does not display Accept or Reject options for the agent.

In response to this operation, Service Guide will render the call controls that are needed for the agent to interact with the active call session.

Payload
{
    data: {
        phoneNumber: string,
        callId: string,
        connectedTime: integer | string | Date
    },

    error: object<{
        isError: boolean, 
        message: string }> (optional)
   }
}
Parameter Description

phoneNumber: Customer phone number.

callId: A unique identifier representing the newly established call session.

connectedTime: An optional parameter representing the start of the conversation. If present, it can be an integer representing UNIX timestamp OR a String representing datetime in ISO-8601 OR a javascript Date object.

Error Parameter Description

If the partner applications receives an error while establishing the call session with the customer and agent, it can notify Service Guide about the error by including the "error" object in the payload instead of including the "data" object.

Error object has following properties:

  • isError: Boolean representing whether or not an error occurred.
  • message: An error code representing the type of error that occurred. Possible values are "CONNECT_​FAILED".
Notes

Both the callReceived and initiatedCallSession operations expect a callId parameter. This is required because a CTI vendor might not generate a new call identifier until a call is connected. Therefore, the call identifier might not be available when the callReceived operation is invoked.

The "connectedTime" paramater can be used if the call was already in progress via another CTI software before the Service Guide window was opened. In this case, it is useful to send the timestamp from the beginning of the conversation so that Service Guide can correctly reflect the call length instead of starting the timer from 0.

Operation: endCallSession

This table provides details of the endCallSession operation:

Operation Component Details
Description

The Partner Application can invoke this operation when the call is disconnected from the CTI vendor.

Note that if the agent disconnects the call in the Service Guide interface, this operation should be invoked when the call is actually disconnected by the CTI vendor in response to the Agent disconnect request.

Payload
{
    data: {
       callId: string,
       callDuration: number (optional)
    },

    error: object<{
        isError: boolean, 
        message: string }> (optional)
   }
}
Parameter Description

callId:

A unique identifier for the call session that ended.

callDuration:

Optional call duration in seconds.

Error Parameter Description

If the partner applications receives an error while disconnecting the call session, it can notify Service Guide about the error by including the "error" object in the payload instead of including the "data" object.

Error object has following properties:

  • isError: Boolean representing whether or not an error occurred.
  • message: An error code representing the type of error that occurred. Possible values are "DISCONNECT_​FAILED".
Notes None

Operation: callMuted

This table provides details of the callMuted operation:

Operation Component Details
Description

This operation should be invoked to notify Service Guide that a request to mute an ongoing call was successfully processed.

This operation can also be used to notify Service Guide if the call was externally muted so that Service Guide can update itself.

Payload
{
    data: {
       callId: string
    },

    error: object<{
        isError: boolean, 
        message: string }> (optional)
   }
}
Parameter Description

callId:

A unique identifier for the call that was muted.

Error Parameter Description

If the partner applications receives an error while muting the call, it can notify Service Guide about the error by including the "error" object in the payload instead of including the "data" object.

Error object has following properties:

  • isError: Boolean representing whether or not an error occurred.
  • message: An error code representing the type of error that occurred. Possible values are "MUTE_​FAILED".
Notes None

Operation: callUnmuted

This table provides details of the callUnmuted operation:

Operation Component Details
Description

This operation should be invoked to notify Service Guide that a request to un-mute an ongoing call was successfully processed.

It can also be used to notify Service Guide if the call was externally un-muted so that Service Guide can update itself.

Payload
{
    data: {
       callId: string
    },

    error: object<{
         isError: boolean,
         message: string }> (optional)
    }
}
Parameter Description

callId:

A unique identifier for the call that was un-muted.

Error Parameter Description

If the partner applications receives an error while unmuting the call, it can notify Service Guide about the error by including the "error" object in the payload instead of including the "data" object.

Error object has following properties:

  • isError: Boolean representing whether or not an error occurred.
  • message: An error code representing the type of error that occurred. Possible values are "UNMUTE_​FAILED".
Notes None

Operation: callOnHold

This table provides details of the callOnHold operation:

Operation Component Details
Description

This operation should be invoked to notify Service Guide that a request to put the call on hold was successfully processed.

It can also be used to notify Service Guide if the call was externally put on hold so that Service Guide can update itself.

Payload
{
    data: {
       callId: string
    },

    error: object<{
         isError: boolean,
         message: string }> (optional)
    }
}
Parameter Description

callId:

A unique identifier for the call that is placed on hold.

Error Parameter Description

If the partner applications receives an error while putting the call on hold, it can notify Service Guide about the error by including the "error" object in the payload instead of including the "data" object.

Error object has following properties:

  • isError: Boolean representing whether or not an error occurred.
  • message: An error code representing the type of error that occurred. Possible values are "HOLD_​FAILED".
Notes None

Operation: callResumed

This table provides details of the callResumed operation:

Operation Component Details
Description

This operation should be invoked to notify Service Guide that a request to resume a call that was previously put on hold was successfully processed.

It can also be used to notify Service Guide if the call was externally resumed so that Service Guide can update itself.

Payload
{
    data: {
       callId: string
    },

    error: object<{
         isError: boolean,
         message: string }> (optional)
    }
}
Parameter Description

callId:

A unique identifier for the call that is resumed.

Error Parameter Description

If the partner applications receives an error while resuming the call that was previously put on hold, it can notify Service Guide about the error by including the "error" object in the payload instead of including the "data" object.

Error object has following properties:

  • isError: Boolean representing whether or not an error occurred.
  • message: An error code representing the type of error that occurred. Possible values are "RESUME_​FAILED".
Notes None

Operation: transcriptReceived

This table provides details of the transcriptReceived operation:

Operation Component Details
Description

This operation should be invoked in response to the request transcript event to send the text transcript of the call. The partner application should request the transcript from the CTI backend via CTI-specific APIs.

It is not necessary to fetch the transcript from the CTI backend at the point when the call ends. If the appropriate CTI vendor APIs are available, a real-time transcript can be collected during the call and held in front-end memory, which then can be used at the end of the call.

Payload
{
    data: {
       agentTranscripts: array<{
            channel: string,
           text: string,
           offsetMs: number }> (optional),

      customerTranscripts: array<{
           channel: string,
           text: string,
           offsetMs: number }> (optional),

      combinedTranscripts: array<{
           channel: string, 
           text: string, 
           offsetMs: number }> (optional)

    },

    error: object<{
         isError: boolean, 
         message: string }> (optional)
    }
}
Parameter Description

agentTranscripts:

An array of collected text transcripts for the agent's side of the conversation. Each element consists of the channel , text and offsetMS.

customerTranscripts:

An array of collected text transcripts for Customer's side of conversation. Each element consists of the channel , text and offsetMS.

combinedTranscripts:

An array of collected text transcripts for the whole conversation. Each element consists of the channel , text and offsetMS.

channel:

Either 'internal' or 'external'

text:

Actual speech to text transcript

offsetMs:

Offset in milliseconds from the conversation start time.

Error Parameter Description

If the partner applications receives an error while collecting the call transcript from CTI backend, it can notify Service Guide about the error by including the "error" object in the payload instead of including the "data" object.

Error object has following properties:

  • isError: Boolean representing whether or not an error occurred.
  • message: An error code representing the type of error that occurred. Possible values are "TRANSCRIPTION_​FAILED".
Notes

Either only combinedTranscripts OR both agentTranscripts and customerTranscripts must be included in the payload.

The channel property should have one of these values, based on who the conversation owner is:

channel='internal'

All elements of agentTranscripts OR those elements in combinedTranscripts that belong to agent.

channel='external'

All elements of customerTranscripts OR those elements in combinedTranscripts that belong to customer.

Operation: callWrappedUp

This table provides details of the callWrappedUp operation:

Operation Component Details
Description

To be invoked when the call wrap up has been completed on the CTI side and the Service Guide UI should be notified so that it can reset itself, making the agent available for the next call.

Payload
   {
     data: {
       callId: string
     },
     error: object<{
        isError: boolean,
        message: string
     }> (optional)
   }
Parameter Description

callId:

A unique identifier for the call for which the wrapup was done.

Error Parameter Description

If the partner applications receives an error while capturing the wrap up information on CTI side, it can notify Service Guide about the error by including the "error" object in the payload instead of including the "data" object.

Error object has following properties:

  • isError: Boolean representing whether or not an error occurred.
  • message: An error code representing the type of error that occurred. Possible values are "WRAPUP_​FAILED".
Notes None

Operation: loggedOut

This table provides details of the loggedOut operation:

Operation Component Details
Description

This operation should be invoked in response to the "logout" event to notify the Service Guide that the partner application has finished performing any cleanup in response to the "logout".

Payload None
Parameter Description Not Applicable
Notes None