Integrating a custom service desk with Orchestrate Chat
A custom service desk allows organizations to efficiently manage and resolve user requests, issues, or incidents. By tailoring the experience to your specific needs, it enhances customer satisfaction, boosts operational efficiency, and provides better visibility and control.
Prerequisites
Before you start the integration, you need to create an object or class that adheres to the Orchestrate Chat service desk model standards. Download the required interface here.
Integration overview
Orchestrate Chat supports integration with custom service desks or contact centers, which enables users to interact with human agents. To integrate:
- Create a compliant object or class based on the Orchestrate Chat service desk model. For more information, see Prerequisites.
- Implement a factory function in your Orchestrate Chat configuration that returns a new instance of your integration when requested.
Requirements for custom service desk integration
To work with Orchestrate Chat, your service desk must:
- Support browser-based communication.
- Comply with Orchestrate Chat’s interface standards.
- Provide HTTP endpoints or WebSocket interfaces to:
- Start chats.
- Receive user messages.
- Send agent messages to users.
Integration steps
To enable communication between Orchestrate Chat and your custom service desk, you must:
- Develop the integration code to handle actions like initiating chats and sending messages to agents. Make sure that it meets Orchestrate Chat’s API specifications.
- Expose the integration through a factory function so Orchestrate Chat can access and run it.
- Include your integration code in your website or host it separately.
Handling secrets
If your service desk requires secrets (such as API keys):
- Use server-side middleware to proxy requests.
- The middleware adds the required secrets before the request is forwarded.
Cross-origin requests
If your service desk is hosted on a different domain:
- Make sure it supports CORS.
- If not, proxy the requests through your server.
Example integration
The following basic example shows how to register a custom service desk integration that uses a factory function:
<script>
// Define your custom service desk class
class MyServiceDesk {
constructor(parameters) {
this.callback = parameters.callback;
console.log("Service Desk started", parameters);
}
getName() {
return 'MyServiceDesk';
}
startChat() {
// Start chat logic
// Call callback.agentJoined when an agent joins
// Call callback.sendMessageToUser when agent sends a message
}
endChat() {
// End chat logic
}
sendMessageToAgent() {
// Send user message to agent
}
}
// Register the integration with Orchestrate Chat
window.wxOConfiguration = {
orchestrationID: '...',
serviceDesk: {
customFactory: (parameters) => new MyServiceDesk(parameters),
},
};
</script>
API overview
Orchestrate Chat provides a public API for integrating with custom service desks. Your integration must implement:
startChat: Notify the service desk when a chat starts.sendMessageToAgent: Send user messages to the agent.
Orchestrate Chat also provides callback functions for the service desk to respond:
agentJoined: Notify when an agent joins.sendMessageToUser: Send messages from the agent to the user.
Routing and communication
- The
serviceDesk.customFactoryproperty must return an object or class with the required methods. - The factory receives a callback object that your integration uses to communicate back to Orchestrate Chat.
Chat history for agents
Orchestrate Chat provides configuration to display chat history in the agent interface.
Agents can view previous conversations with users.
Interaction flow
A typical interaction works in the following way:
- Orchestrate Chat initializes a single instance of your custom service desk that uses
customFactory. - A user sends a message, triggering a
connect_to_agentresponse. - If implemented, Orchestrate Chat calls
areAnyAgentsOnlineto check agent availability. - User clicks Request Agent.
- Orchestrate Chat calls
startChat, initiating a session with the service desk. - A banner informs the user that an agent is being connected.
- When an agent joins, your integration calls
callback.agentJoined. - Agent messages are sent through
callback.sendMessageToUser. - User messages are sent through
sendMessageToAgent. - When the chat ends, Orchestrate Chat calls
endChat.
API details
To integrate a custom service desk with Orchestrate Chat, you need to implement specific methods defined in the TypeScript interfaces.
Methods to implement (from the custom service desk interface)
Your integration must include the following methods:
getName: Returns the name of your service desk.startChat: Starts a new chat session.endChat: Ends the current chat session.sendMessageToAgent: Sends a message from the user to the agent.areAnyAgentsOnline(optional): Checks if any agents are currently available.
Callback methods (from ServiceDeskCallback interface)
These methods allow your service desk to send updates back to Orchestrate Chat:
agentEndedChat: The agent ended the chat.agentJoined: The agent joined the chat.agentLeftChat: The agent left the chat.agentTyping: The agent is typing.beginTransferToAnotherAgent: Starts a transfer to another agent.sendMessageToUser: Sends a message from the agent to the user.setErrorStatus: Reports an error status to Orchestrate Chat.
Supported response types
The callback.sendMessageToUser method is used to display messages to users.
Supported formats:
- Simple text string: Displays basic text messages.
- MessageResponse object: A structured format used by Orchestrate Chat (only a subset of types is supported).
Currently, the custom service desk integration supports only text (simple string) response types.