Amazon Connect Streams API
Amazon Connect Streams API is a real-time communication toolkit that integrates web applications with Amazon Connect. It provides a bi-directional pipeline that streams contact and agent events in real time through WebSocket connections. This JavaScript library lets you build custom agent desktops, embed softphone capabilities into CRMs, and receive real-time notifications about contact state changes, all without polling or refreshing.
Contact Control Panel (CCP)
Web browser application that agents use to handle customer inquiries. Agents can dial
Context
Structured data representing current state of contact
Events
Represent changes in states for different interfaces. Applications listen to events to update agent interface or integrate with other systems.
Handlers
Handlers are callback routines called after events take place in your application. They define the specific action that follows an event, essentially answering “what should happen when X occurs?” When your application subscribes to events (like contact connected, agent state change, or button clicked), you link handler functions that execute automatically when those events fire. They’re the bridge between event detection and action execution.
Interfaces
Interfaces provide access through multiple API interfaces, giving developers the ability to handle events associated with agents and contacts and call action methods. In Amazon Connect context, interfaces are the contracts or touchpoints where different systems interact - like the Streams API interface for agent desktop integration, REST API interfaces for programmatic control, or EventBridge interfaces for event consumption. They define what methods are available and how to interact with them.
Event Subscription
Application subscribes to events and related handler is called. Developer gets event context like contact information and displays in user interface.
Action Methods
Methods that can be called to get or set context on agents
Consistent Experience Benefit
Maintain consistent UI/UX for agents across business applications. CCP seamlessly integrated into existing CRM and tools for unified application.
Enhanced Flexibility Benefit
Fully customize the CCP including look and feel
Streamlined Integration Benefit
Facilitates integration with existing systems and data sources. Display customer data
Built-in Features
CCP widget directly integrated into web-based agent applications. Use existing functionality without custom development.
Extended Functionality
Extend agent user interface with Amazon Connect functionality. Example: integrate Customer Profiles to provide unified view of customer information.
Custom Agent Experience
Build customized interface that meets specific functional and business requirements. Handle real-time data on agent and contact state events and control agent workflow programmatically.
CRM Integration
Embed call and agent status controls within CRM interface. Use Streams to handle events and action methods to control agent workflow.
connect.core.initCCP()
API to initialize the CCP widget in your webpage. Mandatory first step to verify setup is correct and application can listen to events.
agent.onStateChange()
Method to subscribe to notifications when CCP agent’s state changes. Triggered when agent’s state changes including routable and not routable states.
contact.onAccepted()
Method to subscribe to event when agent accepts incoming contact. Use to display customer information when contact is accepted.
agent.onRoutable()
Subscribes to routable event triggered when agent becomes available to receive new contacts. Occurs when agent chooses Available button in CCP.
agent.onNotRoutable()
Subscribes to not routable event triggered when agent becomes unavailable. Agent is paused for break
agent.onOffline()
Subscribes to offline event triggered when agent goes offline. Occurs when agent chooses Offline button. Offline is logged out not paused.
Agent API
Offers methods to subscribe to events and perform actions on behalf of agent. Provides event subscription methods and action methods.
Connection API
Provides action methods to manipulate state of particular connection in a contact. Has no event subscriptions. Connections are transient and cannot be accessed after contact completes.
Connection API is purely for actions - if you need to know when something happens, use Contact API events.”
connection.getContactId()
Gets unique contactId of contact to which this connection belongs. Used to identify specific contact.