# Agent Desk
Source: https://docs.asapp.com/agent-desk
Use the Agent Desk to empower agents to deliver fast and exceptional customer service.
Agent Desk is an end-to-end AI-native® messaging platform designed for digital customer service. It enhances digital adoption, maintains customer satisfaction (CSAT), and increases contact center capacity efficiently.
At its core, Agent Desk uses an AI-Native design approach. AI is not just an added feature, but the foundation for building the entire platform.
Agent Desk leverages advanced machine learning algorithms and generative AI to provide comprehensive support for digital customer service. This holistic approach benefits agents, leaders, and customers alike, offering a seamless and intelligent messaging experience across various channels.
### Supported Channels
Agent Desk supports [multiple messaging channels](/agent-desk/integrations), including:
* [Android SDK](/agent-desk/integrations/android-sdk "Android SDK")
* [Apple Messages for Business](/agent-desk/integrations/apple-messages-for-business "Apple Messages for Business")
* [iOS SDK](/agent-desk/integrations/ios-sdk "iOS SDK")
* [Voice](/agent-desk/integrations/voice "Voice")
* [Web SDK](/agent-desk/integrations/web-sdk "Web SDK")
* [WhatsApp Business](/agent-desk/integrations/whatsapp-business "WhatsApp Business")
## How it works
Agent Desk seamlessly integrates with your existing channels, creating a unified ecosystem for customer interactions and agent support. Here's how it enhances the experience for all stakeholders:
**For your customers**:
* Seamlessly connect with your [preferred messaging channels](#implement-messaging-platform) for a consistent brand experience.
* Benefit from intelligent automation with [**Virtual Agent**](#virtual-agent).
**For your agents**:
* Leverage the powerful [**Digital Agent Desk**](#digital-agent-desk).
* Boost productivity with built-in AI-powered tools like **AI Summary** and **AI Compose**.
**For your management team**:
* Gain valuable insights with [**Insights Manager**](#insights-manager)
By seamlessly blending AI capabilities with human expertise, Agent Desk elevates your customer service operations to new heights of efficiency and satisfaction.
### Virtual Agent
Virtual Agent is our cutting-edge automation solution that enables organizations to:
* Recognize intent intelligently and route seamlessly
* Automate common customer inquiries with natural language
* Handle dynamic input and secure forms
* Customize workflows tailored to your brand's unique requirements
Learn more about Virtual Agent
### Digital Agent Desk
Digital Agent Desk is our AI-enhanced app that empowers agents to deliver exceptional customer service via messaging:
* Send and receive messages across multiple channels
* Manage concurrent conversations with intelligent prioritization
* Access interaction history for context-aware support
* Use AI tools like AI Compose, Autopilot, and AI Summary for faster Average Handle Time (AHT)
* Navigate an intuitive interface with integrated knowledge and customer information
Learn more about Digital Agent Desk
### Insights Manager
Insights Manager is our powerful analytics tool that optimizes contact center operations:
* Identify and respond to customer trends in real time
* Monitor contact center activity with intuitive dashboards
* Manage conversation volume and agent workload efficiently
* Gain insights through performance analysis and reporting
* Investigate customer interactions for quality and compliance
Insights Manager provides data-driven insights to improve your customer service operations.
Learn more about Insights Manager
## Implement Agent Desk
To start using Agent Desk, you need to choose the channels your users will engage with, and configure Agent Desk, Virtual Agent, and Insights Manager to meet your needs.
Connect ASAPP to your messaging channels.The main application where agents can communicate with customers through chat (message)View feature release announcements for ASAPP Messaging
# Digital Agent Desk
Source: https://docs.asapp.com/agent-desk/digital-agent-desk
Use the Digital Agent Desk to empower agents to deliver fast and exceptional customer service.
The Digital Agent Desk for chat serves as the main application where agents communicate with customers. Agents can:
* Send and receive messages across multiple channels.
* Manage concurrent conversations with intelligent prioritization.
* Access interaction history for context-aware support.
* Utilize AI tools like AI Compose, Autopilot, and AI Summary for faster Average Handle Time (AHT).
* Access an intuitive interface with integrated [knowledge base](/agent-desk/digital-agent-desk/knowledge-base) and customer info.
## AI tools
Digital Agent Desk captures agent conversations and actions to power Machine Learning (ML) models. These models power a number of AI tools that help agents deliver exceptional customer service.
Automatically sends messages to customers based on conversation context to allow agents to focus on meaningful parts of a conversation. You can configure the Digital Agent Desk to send messages in English, Spanish, or French.
* **AutoPilot Greeting**: Sends a greeting message to customers when conversations start.
* **AutoPilot Ending**: Sends a closing message to customers when conversations end.
* **AutoPilot Timeout**: Automatically handles closing conversations where customers have become inactive.
Contact your ASAPP account team to enable Spanish or French language support for AutoPilot.
Shows full responses to your agent based on conversation context, allowing your agent to select a response from the list to quickly reply.
As your agent types, the system suggests new complete responses. This empowers agents to take advantage of the full response library.
Proposes inline completions as your agent types, streamlining the typing and response process.
Agents can use a library of pre-written responses either from your own organization or from their own responses.
Streamlines post-call work by automatically summarizing conversations.
## Right-Hand Panel
The right-hand panel serves as the hub for all agent activity. It provides a range of tools like key customer information, conversation history, knowledge base, and more to help agents deliver fast, accurate, and exceptional customer service.
This data comes directly from ASAPP, or from your own CRM or other systems.
## Next Steps
Learn how to navigate the Agent DeskLearn how to set up and use the Knowledge BaseConnect your own systems and CRMs to the Agent Desk
# Digital Agent Desk Navigation
Source: https://docs.asapp.com/agent-desk/digital-agent-desk/agent-desk-navigation
Overview of the Digital Agent Desk navigation and features.
## App Overview
1. [Main Navigation](#main-navigation)
2. [Conversation](#conversation)
3. [Agent Solutions](#agent-solutions)
## Main Navigation
### A. Agent Stats
| **Feature** | **Feature Overview** | **Configurability** |
| :---------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------ |
| Agent Stats | Basic statistics related to chats handled since the agent last logged into Agent Desk (Current Session) or to all chats handled in Agent Desk (All Time). | Core |
### B. Navigation
| **Feature** | **Feature Overview** | **Configurability** |
| :--------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------ |
| Concurrency Slots | The agent can see their concurrent chats and available 'Open Slots' directly in Agent Desk. | Configurable |
| Waiting Timers | A timer displays when either the customer is waiting or the agent is waiting. The customer waiting time appears in larger text with a badge around it | Core |
| Last Message Preview | Preview of the last message a customer sent in chat. | Core |
| Color Coded Chat Cards | Unique color assigned to each chat card to help distinguish chats. | Core |
| Copy Tool | Hover-over tool to easily copy entities across Agent Desk. | Core |
### C. Help & Resources
| Feature | Feature Overview | Configurability |
| :----------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------- |
| Agent Feedback | Text form for agent to send feedback to ASAPP team (available by default; can be disabled if an agent has an active chat, if an agent is in an available status, or in both instances). | Configurable |
| Keyboard Shortcuts | List of Keyboard Shortcuts. **Ctrl +S** | Core |
| Patent Notice | List of Patents. | Core |
### D. Preferences
| Feature | Feature Overview | Configurability |
| :---------------- | :----------------------------------------------------- | :-------------- |
| Font Size | Select the Font Size: **Small**, **Medium**, **Large** | Core |
| Color Temperature | Adjust the display to reduce eye strain. | Core |
### E. Status Switcher & Log Out
| **Feature** | **Feature Overview** | **Configurability** |
| :----------- | :-------------------------------------------------------------------------------------------------------------------------------------- | :------------------ |
| Agent Status | Configurable list of Agent statuses: **Active**, **After Chat Wrap-Up**, **Coaching**, **Lunch/Break**, **Team Meeting**, **Training**. | Configurable |
| Go to Admin | Opens the Admin Dashboard in another tab. | Core |
| Log Out | Logs out of Digital Agent Desk | Core |
## 2. Conversation Navigation
### A. Status
| **Feature** | **Feature Overview** | **Configurability** |
| :---------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------ |
| Active/Away Status | Configurable list of 'Away' statuses (instead of binary option 'Active' / 'Away'). | Configurable |
| Auto Log Out Inactivity and After X Hours | If an agent does not move their mouse for over X hours, auto-log them out of Agent Desk.
If an agent is logged in for more than X hours, even if they are active, log them out (unless they are in an active chat with a customer). | Configurable |
### B. Navigation
| **Feature** | **Feature Overview** | **Configurability** |
| :--------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------ |
| Waiting Timers | A timer displays when either the customer is waiting or the agent is waiting.
The customer waiting time appears in larger text with a badge around it. | Core |
| Last Message Preview | Preview of the last message a customer sent in chat. | Core |
| Color Coded Chat Cards | Unique color assigned to each chat card to help distinguish chats. | Core |
| Copy Tool | Hover-over tool to easily copy entities across Agent Desk. | Core |
## 3. Conversation
### A. Conversation Header
| **Feature** | **Feature Overview** | **Configurability** |
| :------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------ |
| Chat Duration | Indication of how long the customer has been chatting and waiting, at the top of the conversation panel. | Core |
| **Contextual Actions (From Left to Right)** | | |
| Quick Notes | Enables an agent to type and save notes during a conversation that will save in Conversation History | Configurable |
| Secure Messaging | Enables an agent to send an invite to customers to share sensitive information (e.g. credit card number) securely. | Configurable |
| Send to Flow | Expose **Send Flow** buttons in the center panel drop-down menu that allow an agent to send the customer back to SRS and into a particular automated flow. | Configurable |
| Autopilot Forms / Quick Send | Configurable forms and flows to send to customer and remain connected. You can configure deep links and single step flows. | Configurable |
| Co-Browsing | Enables an agent to send an invitation to a customer to share their screen. The agent has limited capabilities (can scroll, draw, and focus, but can't click or type). | Configurable |
| **End Controls** | | |
| Autopilot Timeout (APTO) | Allows an agent to initiate an autopilot flow that checks in and eventually times out an unresponsive customer; timeout suggestions can appear after an initial conversation turn with a live agent | Configurable |
| Timeout | Enables the agent to timeout a customer. | Core |
| Transfer | Enables the agent to transfer a customer to another queue or individual agent. Queues are only available for transfer if business hours are open, the queue is not paused, and at least one agent in the queue is online. If needed, specific queues can be excluded from the transfer menu. | Configurable |
| End Chat | Enables the agent to close an issue. | Core |
| Auto Transfer on Agent Disconnect | If agents disconnect from Agent Desk for over 60 seconds, ASAPP will auto transfer any currently assigned issues to another agent. | Core |
| Auto Requeue if Agent is unresponsive | When a chat is first connected to an agent, give them X seconds to send their first message. If they exceed this timer, auto-reassign the issue to the next available agent. | Configurable |
### B. Conversation
| **Feature** | **Feature Overview** | **Configurability** |
| :--------------- | :---------------------------------------------------------------------------------------------- | :------------------ |
| Chat Log | Enables scrolling through the customer's previous conversation history. | Core |
| Message Previews | Enables viewing a preview of what the customer is typing before the customer sends the message. | Core |
### C. Composer
| **Feature** | **Feature Overview** | **Configurability** |
| :----------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------ |
| Autosuggest | Suggested responses before the agent begins typing based on conversational context. | Core |
| Autocomplete | Suggested responses after the agent begins typing based on conversational context. | Core |
| Fluency boosting | If an agent makes a known spelling error while typing and hits the space bar, ASAPP will auto-correct the spelling mistake. The correction is indicated by a blue underline, and the agent may click on the word to undo the correction. | Core |
| Profanity handling | Generic list of phrases ASAPP disables agents from sending to customers. | Core |
## 4. Agent Solutions
### Customer Information
| **Feature** | **Feature Overview** | **Configurability** |
| :------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------ |
| Customer Profile (A) | Displays customer, company, and specific account information for authenticated customers. | Configurable |
| Customer History (B) | A separate tab that gives a quick snapshot of each current and historical interaction with the customer, including time, duration, notes, intent, etc. | Core |
| Copy Tool (C) | Hover-over tool to easily copy entities across Agent Desk. | Core |
### Knowledge Base
| **Feature** | **Feature Overview** | **Configurability** |
| :------------------------------------------------------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- |
| [Knowledge Base](/agent-desk/digital-agent-desk/knowledge-base) (A) | Agents can traverse a folder hierarchy of customer company specific content to search, add a favorite, and send content to customers. Select **Favorites** or **All Files**. | Requires you to upload and maintain Knowledge Base content via Admin or an integration. |
| List of Favorites or All Files (B) | Displays your Favorites or All Files. | Configurable |
| Knowledge Base Suggestions (C) | Suggests Knowledge Base articles to agents. | Core |
| Contextual Actions (D) | Agents can attach an article (send to a customer) or make it a favorite. | Configurable |
### Responses
Feature
Feature Overview
Configurability
Custom Responses (A)
Agents can create, edit, search, and view custom responses in Agent Desk. Agent Desk uses these custom responses in Auto Suggest. Click + to create new custom responses. To edit, hover over a response and select Edit. Click the Search icon to search custom responses.
If an agent sends something that isn't in their custom library or the global whitelist, ASAPP recommends it back to them from a growing list of their favorites.
Core
Global Responses
(A)
Agents can search, view, and click-to-insert responses from the global whitelist. Click the Search icon to search the global responses.
Core
Navigate Folders (B)
In both the custom and global response libraries, agents can navigate into and out of folders.
Core
Uncategorized Custom Responses (C)
Single custom responses that you add but do not categorize into a specific folder display here.
Core
Click-to-Insert (D)
In both the custom and global response libraries, agents can hover over a response and click Insert to insert the full text of the selected response into the typing field.
Core
Chat Takeover
Managers can takeover an agent's chat.
Core
Receive attachments
End customers can send pdf attachments to agents in order to provide more information about their case.
Core
### Chat Takeover
Administrators (managers or supervisors) can take over chats from agents or unassigned chats in the queue. This feature is useful for:
* Closing resolved chats that need disposition
* Handling complex or convoluted conversations
* Managing queue traffic during high-volume periods
To take over a chat:
1. Navigate to the conversation in Live Insights
2. Open the transcript area
3. Click the Takeover button in the upper left-hand corner
4. Confirm the takeover action
Once transferred, administrators can continue the chat through Agent Desk. Access to this functionality requires appropriate permissions set up by ASAPP.
### Wrap-Up
| **Feature** | **Feature Overview** | **Configurability** |
| :----------------------- | :---------------------------------------------------------------- | :------------------ |
| Chat Notes (A) | Agents can leave notes during a chat and at the end of a chat. | Core |
| End Chat Disposition (C) | Ask the customer if the initial intent was correct. | Core |
| End Chat Resolution (D) | Agents can indicate if an issue is resolved or not while closing. | Core |
### Receiving Attachments
Agents can ask for and receive PDF and image attachments from end customers. This feature is particularly useful for scenarios like fraud cases where agents need proof of transactions.
When a customer sends an attachment, the agent will receive a notification in the chat.
Images can be viewed in a modal while PDFs can be downloaded for the agent to view within their own desktop environment.
* JPEG
* JPG
* PNG
* PDF
Images: Maximum 10MB
PDFs: Maximum 20MB
Apple Messages for Business
### Undelivered Messages
If the live agent fails to send a message to the customer, the agent will see an undelivered message indicator near the transcript.
Message delivery issues impact customer experience, agent efficiency, and operational clarity. With this feature:
* Agents gain clarity into whether a customer actually received the message they sent, reducing unnecessary repetition.
* Admins and supervisors gain visibility into reliability issues that previously went undetected, enabling quicker diagnosis and resolution.
* Quality Assurance and Compliance teams benefit from transcripts that accurately reflect what the customer saw.
* CSMs and Delivery teams gain insights to help customers troubleshoot delivery issues and validate expected outcomes.
This feature strengthens trust in the CXP transcript as an accurate record and improves the overall reliability of customer-facing communication flows.
When a message fails to deliver, the following occurs:
1. When a message fails to deliver to a customer, the transcript displays a **"Failed to send"** indicator directly below the undelivered message.
2. The indicator shows that message delivery failed and displays an additional banner stating "Messaging service is unavailable".
3. Agents immediately see this status when viewing the transcript during customer interactions.
4. Admins and supervisors see the same delivery failure status in conversation history and can use this information for quality assurance and review.
5. The feature automatically applies to all customers without requiring any action from end users.
# Agent SSO
Source: https://docs.asapp.com/agent-desk/digital-agent-desk/agent-sso
Learn how to use Single Sign-On (SSO) to authenticate agents and admin users to the Digital Agent Desk.
ASAPP recommends that customers use SSO to authenticate agents and admin users to our applications.
In this scenario:
1. ASAPP acts as the Service Provider (SP) while the customer serves as the Identity Provider (IDP).
2. The customer's authentication system performs user authentication using their existing customer credentials.
3. ASAPP supports Service Provider Initiated SSO. Customers provide the SSO URL to agents and admins.
4. The URL points to the customer's SSO service, which will authenticate the users via their authentication system.
5. Once ASAPP authenticates the user, the customer's SSO service sends a SAML assertion with user information to ASAPP's SSO service.
6. ASAPP uses the information inside the SAML assertion to identify the user and redirect them to the appropriate application.
The diagram below illustrates the IDP-initiated SSO flow.
## Configuring Single Sign-On via SAML
### Environments
ASAPP supports SSO in non-production and production environments. We strongly recommend that customers configure SSO in both environments.
### Exchange of SAML metadata
Both ASAPP and the customer generate their respective SAML metadata and exchange the metadata files. Each environment requires different metadata, so teams must generate metadata once per environment.
Sample metadata file content:
```json theme={null}
REDACTEDREDACTEDurn:oasis:names:tc:SAML:2.0:nameid-format:unspecified
```
### SAML Profile Configuration
Next, ASAPP and the customer configure their respective SSO services with each other's SAML profile. Teams can achieve this by importing the SAML metadata into the SSO service (if it supports a metadata import feature).
### SAML Attributes Configuration
SAML Attributes are key-value fields within the SAML message (also called SAML assertion) that the Identity Provider (IDP) sends to the Service Provider (SP).
ASAPP requires the following fields to be included with the SAML assertion
| **Attribute Name** | **Required** | **Description** | **Example** | |
| :----------------- | :----------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------ | ------- |
| userId | yes | user's unique identifier used for authentication. Can be a unique readable value such as user's email or an opaque identifier such as a customer's internal user ID. | [jdoe@company.com](mailto:jdoe@company.com) | |
| firstName | yes | user's first name | John | |
| lastName | yes | user's last name | Doe | |
| nameAlias | yes | user's display name. Allows an agent, based on their personal preference or company's privacy policy, to set an alias to show to the customers they are chatting with. If this is not sent then the agent firstName will be displayed. | John Doe | |
| roles | yes | the roles the user has within the ASAPP platform. Typically mapped to one or more AD Security Groups on the IDP. | representative | manager |
The following fields are not **required** but **desired** to further automate the agent Desk configuration:
| **Attribute Name** | **Required** | **Description** | **Example** | |
| :----------------- | :----------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------- | -------- |
| groups | no | group(s) the user belongs to. This attribute controls the queue(s) that a user is assigned to. Not to be confused with the AD Security Groups (see the **roles** attribute above) | residential | business |
| concurrency | no | number of concurrent chats the user can handle | 5 | |
In addition, any custom fields can be configured in the SAML assertion. See the section below for more details.
### Sending User Data via SAML
ASAPP uses SAML attribute fields to keep user data current in our system. This also allows us to register new users automatically when they log into the ASAPP application for the first time.
In addition to the required fields that ASAPP needs to identify the user, customers can send additional fields in the SAML assertion that can be used for other purposes such as Reporting. An example can be the Agent Location. These fields are specific per customers. The name and possible values of these fields need to be agreed upon and configured prior to the SAML implementation.
### SSO Testing
SSO testing between the customer and ASAPP must be a coordinated effort due to the nature of the IDP-initiated SSO flow. The customer must provide several user accounts to be used for testing. Generally, the test scenarios are as follows:
1. An agent logs in for the first time. ASAPP observes that a new user record is created and the agent lands on the correct ASAPP application for their role (Desk for a rep, Admin for supervisor/manager).
2. The same agent logs out and logs back in. The agent observes that the correct application still opens.
3. Repeat the same test for another user account, ideally with different roles.
Once testing is completed successfully, then the SSO flow is certified for that environment.
Setting up SSO in the Production environment should follow the same steps.
# API Integration
Source: https://docs.asapp.com/agent-desk/digital-agent-desk/api-integration
Learn how to connect the Digital Agent Desk to your backend systems.
ASAPP integrates with your APIs to provide customers and agents with richer and more personalized interactions.
ASAPP accomplishes this by making real-time backend calls to customer APIs, providing customers with current, up-to-date information.
Customers must expose relevant APIs securely for ASAPP to make server-to-server calls.
## Authentication
Customers should secure their APIs with authentication mechanisms, addressing both Customer Authentication and API Authentication.
### API Authentication on behalf of the User
ASAPP leverages customers' existing mechanisms for authenticating their customers, which should ideally remain consistent across different channels.
Systems should issue identifiers with short expiration times while allowing for good user experience without requiring customers to authenticate multiple times during a session.
* **Cookie-based Authentication**: Users post login credentials to the customer's server and receive a signed cookie. The server stores the cookie and places a copy in the browser for use in subsequent interactions during the session. However, teams typically prefer token-based approaches where possible.
* **Token-based Authentication:** Users post login credentials to the customer's server and receive a signed JSON Web Token (JWT). The server does not store this token, making all interactions fully stateless. All client requests include the JWT, which only the server can decode to authenticate every request. For more information on generating and signing JSON Web Tokens, refer to [https://jwt.io/](https://jwt.io/).
**API Endpoint**: `POST /customer_authenticate`
**Request**
```json theme={null}
curl -X POST https://api.example.com/auth/customer_authenticate \
-H 'cache-control: no-cache' \
-d 'username=&password='
```
**Response**
```json theme={null}
{
"issued_at" : "1570733606449",
"JWT" : "",
"expires_in" : "28799"
}
```
ASAPP requires direct access to the "customer\_authenticate" API to retrieve JWTs/cookies programmatically for testing.
#### Communicating Customer Identifier with ASAPP
Customers can implement any mechanism to authenticate their users, as long as they can pass the identifier (cookie, JWT, etc.) to ASAPP. The methods for passing this value to ASAPP depend on the chat channel used: [Web](/agent-desk/integrations/web-sdk/web-authentication), [iOS](/agent-desk/integrations/ios-sdk/user-authentication), or [Android](/agent-desk/integrations/android-sdk/user-authentication).
#### Customer Identifier Requirements
ASAPP uses this customer identifier as a pass-through value by including it as an HTTP Header or in the request body when requesting customer data from backend APIs. Since the Customer Identifier is the only data ASAPP uses to identify users, it must adhere to the following requirements:
* **Unique**: ASAPP will associate every customer chat with this id allowing ASAPP to tie chats from different channels into one single conversation. It is imperative that the Customer Identifier be unique per customer.
* **Consistent**: The Customer Identifier should remain consistent so that even if the customer returns after a significant amount of time, we are able to identify the customer.
* **Opaque**: The Customer Identifier by itself should not contain any customer Personally Identifiable Information (PII). It should be hashed, encoded and/or encrypted so that when used by itself, it is of no value.
### API Authentication using System-level Credential
Customers can secure backend APIs by restricting client access to specific resources for limited time periods.
Teams can implement this using various mechanisms like OAuth 2.0, API Keys, or System Credentials. This section details OAuth using a Client Credentials Grant, which works well for server-to-server communication.
#### Client Credentials Grant
In this mechanism, the client sends a HTTP POST request with the following parameters in return for an access\_token.
* **grant\_type**
* **client\_id**
* **client\_secret**
**API Endpoint**: `POST /access_token`
**Request**
```json theme={null}
curl -X POST https://api.example.com/oauth/access_token?grant_type=client_credentials
\
-H 'cache-control: no-cache' \
-H 'content-type: application/x-www-form-urlencoded' \
-d 'client_id=&client_secret='
```
**Response**
```json theme={null}
{
"token_type" : "Bearer",
"issued_at" : "1570733606449",
"client_id" : “”,
"access_token" : "",
"scope" : "client_credentials",
"expires_in" : "28799"
}
```
### API Authorization
Customers can also use API keys to provide authorization to specific APIs. API keys are passed in the HTTP header along with the authentication token.
**API Endpoint:** POST /getprofile
**Request**
```json theme={null}
curl -X POST https://api.example.com/account/getprofile
-H 'Authorization: Bearer ' \
-H 'customer-auth: JWT ' \
-H 'content-type: application/json' \
-H 'api-key: ' \
```
# Knowledge Base
Source: https://docs.asapp.com/agent-desk/digital-agent-desk/knowledge-base
Learn how to integrate your Knowledge Base with the Digital Agent Desk.
Knowledge Base (KB) is a technology used to store structured and unstructured information that agents can reference while servicing customer inquiries.
You can integrate KB data into ASAPP Desk by manually uploading articles through an offline process or by integrating with digital systems that expose content via REST APIs.
Knowledge Base helps Agents access information without requiring them to navigate external systems by surfacing KB content directly within Agent Desk's Right Hand Panel view.
This approach reduces Average Handle Time and increases concurrency. KB also learns from agent interactions, suggests relevant articles, and supports Agent Augmentation.
## Integration
ASAPP integrates with customer Knowledge Base systems or CRMs to pull data and make it available to Agent Desk. A dedicated service accomplishes this by consuming data from external systems that support standard REST APIs. The service layer offers enough flexibility to integrate with various industry-standard Knowledge Base systems as well as proprietary in-house systems. The service programmatically retrieves new and updated articles regularly to surface fresh and accurate content to agents in real-time.
The system transforms data pulled from external systems into ASAPP's standard format and securely stores it in S3 and in a database. Refer to the [Data Storage](#data-storage) section below for more details.
### Configuration
The service that integrates with customers uses configuration-driven approaches to interface with different systems supporting various data formats and structures.
ASAPP requires the following information to integrate with APIs:
* REST endpoints and API definitions, data schemas and SLAs
* URLs, Connection info, and Test Accounts for each environment
* Authentication and Authorization requirements
* JSON schema defining requests and responses, preferably Swagger
* API Host that can handle HTTPS/TLS traffic
* Resource
* HTTP Method(s) supported
* Content Type(s) supported and other Request Headers
* Error handling documentation
* Response sizes to expect
* API Call Rate limits, if any
* Response time SLAs
* API Response Requirements
* Every 'article' should contain at least a unique identifier and last updated date timestamp.
* Hierarchical data needs to clearly define the parent-child relationships
* Content should not contain any PII/PCI related information
* Refreshing Data
* On a set cadence as determined and agreed upon by both parties
* Size of data to help in capacity planning and scaling
## Data Storage
Once the service receives KB content, it stores the data in a secure S3 bucket that serves as the source of truth for all Knowledge Base articles. The system then structures and packages the data into standard Knowledge Base types: Category, Folder, and Article. The service then cleans, processes, and stores the packaged data in a database for further usage.
## Data Processing
ASAPP runs all Knowledge Base articles stored in the database through a Knowledge Base Ranker service, which ranks articles and feeds Agent Augmentation. Given a set of user utterances, the KB Ranker service assigns a score to every article in the Knowledge Base based on how relevant those articles are for that agent at that moment in the conversation. ASAPP determines relevance by considering the frequency of words in an article within the corpus of articles and words from a given subset of utterances.
## Data Refresh
ASAPP can refresh data periodically and schedule it to meet customer needs. ASAPP uses a Unix cron style scheduler to run the refresh job, which allows flexible configuration.
Data Refresh replaces all current folders and articles with new ones received. The refresh does not affect article ranking, as the system maintains their state separately.
# Live Agent Summary - GenAgent
Source: https://docs.asapp.com/agent-desk/digital-agent-desk/live-agent-summary
Learn how to receive summaries from GenerativeAgent conversations.
When using GenerativeAgent (GA), conversations may escalate to human agents. **Live Agent Summary** automatically generates concise summaries of these conversations, giving your agents the key context they need without requiring them to read through lengthy chat transcripts.
Live Agent Summary helps improve Average Handling Time (AHT) by generating concise, structured summaries that present key information to agents at handoff. The summary highlights:
* Customer intent
* Key actions taken
* Unresolved issues
## How Live Agent Summary Works
Live Agent Summary enhances your existing Digital Agent Desk by automatically generating context during escalations:
* **Smart Context Generation**: The system analyzes GA conversations and creates concise summaries when escalations occur
* **Inline Integration**: The system displays summaries directly in the transcript panel with highlight styling, so agents don't need to switch between views
* **Complete Context**: Agents maintain access to all standard transcript information (customer profile, conversation history) plus the generated insights inline
* **Immediate Understanding**: No need to read through entire conversations - the system highlights key information and makes it easily accessible
## Set Up Live Agent Summary
To set up Live Agent Summary, you need to work with ASAPP to enable the feature in your environment and configure the summary generation parameters:
Contact your ASAPP Implementation Manager to enable GenAgent summaries in your Digital Agent Desk environment.
This involves configuring the summary generation parameters, setting up handoff trigger conditions, and testing the summary output quality.
Live Agent Summary requires GenerativeAgent to be configured and operational in your environment.
Conduct pilot testing with a small group of agents to validate the effectiveness of summaries:
* Review summaries with agents to confirm accuracy and usefulness
* Gather feedback on summary clarity and completeness
* Adjust summary parameters based on agent input and preferences
Once validation is complete, roll out Live Agent Summary to your full agent team:
* Train agents on how to interpret and use summary information effectively
* Establish best practices for leveraging summary context in customer interactions
* Monitor AHT and CSAT metrics to measure improvements and identify optimization opportunities
## Next Steps
After setting up Live Agent Summary, you're ready to improve agent efficiency and enhance customer experience during handoffs.
You may find the following sections helpful in advancing your Digital Agent Desk capabilities:
Learn how to configure and optimize your knowledge base for better agent support.
Configure user roles and permissions to optimize agent access and capabilities.
Set up efficient queue management and routing to complement summary capabilities.
Learn more about GenerativeAgent capabilities that power Live Agent Summary.
# Queues and Routing
Source: https://docs.asapp.com/agent-desk/digital-agent-desk/queues-and-routing
Learn how to manage conversation queues and agent routing in the Digital Agent Desk.
Digital Agent Desk routes customer conversations to the most appropriate agents through a structured workflow:
1. A customer initiates a conversation
2. The system labels the conversation with an intent
3. Queue Routing evaluates the intent and additional criteria to select the appropriate queue
4. The queue assigns the conversation to an available agent from its associated agent group
Work with your ASAPP account team to configure intents, queues, and routing logic that align with your business needs.
## Managing Intents and Queues
An **Intent** classifies each customer conversation (issue) and serves as the primary method of categorization. ASAPP analyzes conversation data and business requirements to determine the available intents.
During runtime, Machine Learning (ML) models automatically assign the most appropriate Intent to each new issue.
**Queue Routing** uses these Intents along with other defined criteria to direct conversations to specific queues (referred to as [Attributes Based Routing](/agent-desk/digital-agent-desk/queues-and-routing/attributes-based-routing)). Each **queue** represents a group of agents qualified to handle particular types of issues.
ASAPP manages the configuration and maintenance of Intents and Queue Routing. Work with your ASAPP account team to optimize these settings for your business needs.
## Optimizing Agent Concurrency
Concurrency controls how many simultaneous conversations each agent manages. Setting appropriate concurrency levels helps balance customer experience with agent workload.
Each agent has an individual concurrency level setting that determines their maximum number of concurrent conversations.
Digital Agent Desk provides several tools to help manage agent workloads:
* [High Effort Issues](#high-effort-issues) - Automatically identifies complex conversations that require more agent attention
* [Flexible Concurrency](#flexible-concurrency) - Dynamically adjusts capacity during natural conversation lulls
### High Effort Issues
By default, each conversation occupies one concurrency slot. However, certain conversations may require more time and attention from agents due to their complexity or scope.
Digital Agent Desk can automatically identify high-effort issues and assign them multiple concurrency slots based on the intent and other attributes.
For example, a technical troubleshooting conversation might count as two slots, while a simple account update remains one slot. This intelligent slot allocation helps:
* Give agents adequate time for complex customer needs
* Maintain balanced workloads across your team
* Improve customer satisfaction on challenging issues
Work with your ASAPP account team to configure complexity rules that align with your specific business scenarios and agent capabilities.
#### Monitoring High Effort Issues
The Real Time Dashboard displays agents handling high-effort issues with a "high effort" icon. Select any agent's name to view their current conversation assignments.
### Flexible Concurrency
Flexible Concurrency maximizes agent productivity by temporarily increasing their conversation capacity during natural downtimes, such as:
* When conversations enter auto-pilot timeout (a period of customer inactivity)
* While agents complete disposition tasks
Configure Flexible Concurrency settings per queue to match different conversation types and agent capabilities.
#### Protecting Agents with Flex Protect
During auto-pilot timeout, the system assumes a conversation is temporarily inactive due to customer inactivity. However, customers may return and resume their conversation at any point during this timeout period. Without protection, this creates a challenging situation where an agent who received a new flexible assignment suddenly needs to handle both the returning customer and their new conversation simultaneously.
Flex Protect prevents this type of overload by:
* Assigning protected status to the agent
* Providing a configurable rest period where the system blocks new flexible assignments for that agent
We recommend enabling Flex Protect as agents may avoid using auto-pilot timeout if they fear being overloaded, leading to longer handle times.
#### Monitoring Flexible Assignments
The Real Time Dashboard displays agents handling flexible assignments with a "flex" icon. Select any agent's name to view their current conversation assignments.
# Attributes Based Routing
Source: https://docs.asapp.com/agent-desk/digital-agent-desk/queues-and-routing/attributes-based-routing
Learn how to use Attributes Based Routing (ABR) to route chats to the appropriate agent queue.
Attributes Based Routing (ABR) uses a rules-based system to determine which agent queue should receive an incoming chat.
ASAPP invokes ABR by default after our Machine Learning model classifies customer utterances to an intent and determines that the intent cannot be handled by an automated flow.
## Attributes of ABR
Attributes can be any piece of information that customers can pass to ASAPP using the integrated SDKs.
ASAPP natively defines the standard attributes below:
* Intent - This is a code determined by running customer utterances through various different ML models.
Ex: ACCTINFO, BILLING
* Web URL - This is the webpage that invoked the SDK. You can use any part of the URL as a value to route on.
Ex: [www.customer.com/consumer/support](http://www.customer.com/consumer/support), [www.customer.com/business/sales](http://www.customer.com/business/sales)
* Channel - This is the channel the chat originated from.
Ex: Web, iOS
The ASAPP SDK defines additional parameters, which can also be used in ABR. You can define these parameters as part of the ContextProvider.
* Company Subdivision
Ex: divisionId1, subDivisionId2
* Segments
Ex: NorthEast, USA, EMEA
You can also define custom customer-specific attributes for routing. Customer Information allows definition of any number of attributes as key-value pairs, which you can set per chat and use for routing to specific agent queues. Refer to the Customer Information section for more details on defining custom attributes.
## Configuration
ABR can use any or all of the above attributes to determine which queue receives a chat. The configuration offers extreme flexibility and can accommodate various complex rules including regular expression matches and multi-value matches.
Contact your implementation manager to model the routing rules.
## Template for Submitting Rules
Customers can create an Excel document with a sheet for each attribute they would like to define. The sheet name should be the name of the attribute and have two columns, one defining all the possible attribute values and the other column containing the name of the queue to be routed to.
If you are going to use multiple attributes in any different combinations, then you should define these conditions in a separate sheet, dedicating a row for every unique combination.
ASAPP will assume that Excel attribute names that do not follow the ASAPP standard are custom defined and passed in 'Customer Information'.
See the [User Management](/agent-desk/digital-agent-desk/user-management) section for more information.
## Queue Management
You can define queues based on business or technical needs. You can define any number of queues and follow any desired naming convention. You can apply business hours to queues individually. For more information on other features and functionality, contact your implementation manager.
You can assign agents to one or more queues based on skills and requirements. Refer to [User Management](/agent-desk/digital-agent-desk/user-management) for more details.
# User Management
Source: https://docs.asapp.com/agent-desk/digital-agent-desk/user-management
Learn how to manage users and roles in the Digital Agent Desk.
You control User Management (roles and permissions) within the Digital Agent Desk.
These roles determine whether a user can authenticate to *Agent Desk*, *Admin Dashboard*, or both. Additionally, roles determine what views and data users see in the Admin Dashboard. You can pass user data to ASAPP via *SSO*, AD/LDAP, or other approved integrations.
This section describes the following:
* [Process Overview](#process-overview)
* [Resource Overview](#resource-overview)
* [Definitions](#definitions "Definitions")
## Process Overview
This is a high-level overview of the User Management setup process.
1. ASAPP demonstrates the Desk/Admin Interface.
2. ASAPP calls with you to confirm access and permission requirements. ASAPP and you complete a configuration spreadsheet defining all roles and permissions.
3. ASAPP sends you a copy of the configuration spreadsheet for review and approval. ASAPP makes additional changes if needed and sends them to you for approval.
4. ASAPP implements and tests the configuration.
5. ASAPP trains you to set up and modify user management.
6. ASAPP launches your new customer interaction system.
## Resource Overview
The following table lists and defines all resources:
Feature
Overview
Resource
Definition
Agent Desk
The App where Agents communicate with customers.
Authorization
Enables you to successfully authenticate via Single Sign-On (SSO) into the ASAPP Agent Desk.
Go to Desk
Enables you to click Go to Desk from the Nav to open Agent Desk in a new tab. Requires Agent Desk access.
Default Concurrency
The default value for the maximum number of chats a newly added agent can handle at the same time.
Default Concurrency
Sets the default concurrency of all new users with access to Agent Desk if no concurrency was set via the ingest method.
Admin Dashboard
The App where you can monitor agent activity in real-time, view agent metrics, and take operational actions (e.g. biz hours adjustments)
Authorization
Enables you to successfully authenticate via SSO into the ASAPP Admin Dashboard.
Live Insights
Dashboard in Admin that displays how each of your queues are performing in real-time. You can drill down into each queue to gain insight into what areas need attention.
Access
Enables you to see Live Insights in the Admin navigation and access it.
Data Security
Limits the agent-level data that certain users can see in Live Insights. If a user is not allowed to see data for any agents who belong to a given queue, that queue will not be visible to that user in Live Insights.
Historical Reporting
Dashboard in Admin where you can find data and insights from customer experience and automation all the way to agent performance and workforce management.
Power Analyst Access
Enables you to see the Historical Reporting page in the Admin Navigation with Power Analyst access type, which includes the following:
Access to ASAPP Reports
Ability to change widget chart type
Ability to toggle dimensions and filters on/off for any report
Export data per widget and dashboard
Cannot share reports to other users
Cannot create or copy widgets and dashboards
Creator Access
Enables you to see the Historical Reporting page in the Admin Navigation with Creator access type, which includes the following:
Power Analyst privileges
Can share reports
Can create net new widgets and dashboards
Can copy widgets and dashboards
Can create custom dimensions/calculated metrics
Reporting Groups
Out-of-the-box groups are:
Everybody: all users
Power Analyst: Users with Power Analyst Role
Creator: Users with Creator role
If a client has data security enabled for Historical Reporting, policies need to be written to add users to the following 3 groups:
Core: Users who can see the ASAPP Core Reports
Contact Center: Users who can see the ASAPP Contact Center Reports
All Reports: Users who can see both the ASAPP Contact Center and ASAPP Core Reports
If you have any Creator users, you may want custom groups created. This can be achieved by writing a policy to create reporting groups based on a specific user attribute (i.e. I need reporting groups per queue, where queue is the attribute).
Data Security
Limits the agent-level data that certain users can see in Historical Reporting. If anyone has these policies, then the Core, Contact Center, and All Reports groups should be enabled.
Business Hours
Allows Admin users to set their business hours of operation and holidays on a per queue basis.
Access
Enables you to see Business Hours in the Admin navigation, access it, and make changes.
Triggers
An ASAPP feature that allows you to specify which pages display the ASAPP Chat UI. You can show the ASAPP Chat UI on all pages with the ASAPP Chat SDK embedded and loaded, or on just a subset of those pages.
Access
Allows you to see Triggers in the Admin navigation, access it, and make changes.
Knowledge Base
An ASAPP feature that helps agents access information without needing to navigate external systems by surfacing KB content directly within Agent Desk.
Access
Enables you to see Knowledge Base content in the Admin navigation, access it, and make changes.
Conversation Manager
Admin Feature where you can monitor current conversations individually in the Conversation Manager. The Conversation Manager shows all current, queued, and historical conversations handled by SRS, bot, or by a live agent.
Access
Enables you to see Conversation Manager in the Admin navigation and access it.
Conversation Download
Enables you to select 1 or more conversations in Conversation Manager to export to either an HTML or CSV file.
Whisper
Enables you to send an inline, private message to an agent within a currently live chat, selected from the Conversation Manager.
SRS Issues
Enables you to see conversations only handled by SRS in the Conversation Manager.
Data Security
Limits the agent-assisted conversations that certain users can see at the agent-level in the Conversation Manager.
User Management
Admin Feature to edit user roles and permissions.
Access
Enables you to see User Management in their Admin navigation, access it, and make changes to queue membership, status, and concurrency per user.
Editable Roles
Enables you to change the role(s) of a user in User Management.
Editable Custom Attributes
Enables you to change the value of a custom user attribute per user in User Management. If disabled, these custom attributes will be read-only in the list of users.
Data Security
Limits the users that certain users can see or edit in User Management.
## Definitions
The following table defines the key terms related to ASAPP Roles & Permissions.
Role
Definition
Resource
The ASAPP functionality that you can permission in a certain way. ASAPP determines Resources when features are built.
Action
Describes the possible privileges a user can have on a given resource. (i.e. View Only vs. Edit)
Permission
Action + Resource. ex. "can view Live Insights"
Target
The user or a set of users who are given a permission.
User Attribute
A describing attribute for a client user. User Attributes are either sent to ASAPP via accepted method by the client, or ASAPP Native.
ASAPP Native User Attribute
A user attribute that exists within the ASAPP platform without the client needing to send it. Currently:
Role
Group
Status
Concurrency
Custom User Attribute
An attribute specific to the client's organization that is sent to ASAPP.
Clarifier
An additional and optional layer of restriction in a policy. Must be defined by a user attribute that already exists in the system.
Policy
An individual rule that assigns a permission to a user or set of users. The structure is generally: Target + Permission (opt. + Clarifier) = Target + Action + Resource (opt. + Clarifier)
## Grouping and Data Filtering via SSO
You can use attributes from your SSO/SAML configuration to control what chats and metrics users see within Live Insights, Conversation Manager, and User Management. This ensures users only see information relevant to their role and responsibilities.
These attributes create a hierarchical structure where:
* BPOs only see their service chats
* Workforce Management users see all chats and metrics for their BPO
* Agents see only their own chats and data
* Managers see chats for their assigned teams
To use this grouping, you need to:
Define groups using the following attributes:
* BPO
* Product
* Role
* Location
Make sure to define a name for each group.
Reach out to your ASAPP account team with the groups you define. ASAPP will implement the groups for you.
Ensure that your SSO/SAML System sends the necessary attributes to ASAPP.
You can reach out to your ASAPP account team with any questions.
Within Live Insights, Conversation Manager, and User Management, you can map the groups you defined to filters and queues. The groups will be applied to filter data and control access based on your defined mappings.
# Insights Manager Overview
Source: https://docs.asapp.com/agent-desk/insights-manager
Analyze metrics, investigate interactions, and uncover insights for data-driven decisions with Insights Manager.
ASAPP's Insights Manager aims to provide relevant and actionable learnings from your data. Insights highlights trends that impact your customers, provides live activity monitoring, volume management tools, in-depth performance analysis and reporting, and tools to conduct investigations on customer interactions.
Insights Manager includes three primary functions:
* Live Insights, to track and monitor agent activity in real time
* Historical Insights, to perform data analysis and output in-depth reports
* Conversation Manager, to conduct investigations on customer interactions
## Live Insights
Live Insights serves as your go-to platform to track and monitor agents, conversations, and performance activity in real time.
* Track agent performance in real-time
* Monitor conversations as they happen through the live transcription service
* Whisper to agents as customer interactions happen to guide and course-correct behaviors
* Keep an eye on all your live performance metrics such as handle time, queue volume, and resolution rate
* Mitigate high queue volume to better manage instances of high traffic
Visit Live Insights for a functional breakdown of reporting interfaces and metrics.
## Historical Insights
Historical Insights is a powerful tool to analyze performance metrics, conduct investigations, and uncover insights to make data-driven decisions.
* Access core performance dashboards that we pre-populate with your data and prepare for conducting analyses
* Program dashboards provide a deep overview of primary conversation and agent metrics
* Automation & Flow dashboards provide insights into the performance of flow containment, successful automations, and intent performance
* Operation & Workforce Management dashboards provide in-depth data to help you understand how agents are utilized and pinpoint areas ripe for improvement
* Outcomes dashboards provide a view into the voice of the customer
* Content creators can create and share dashboards with members of your organization
* Automate report sharing based on your preferred schedule. Attach data to automated emails to continue investigations into your preferred tools
## Conversation Manager
Conversation Manager provides robust features to help you conduct investigations on customer interactions. Use the tools provided to find relevant conversations to support your quality control needs, to deepen research initiated in Historical Insights, or to review performance data associated with your conversations.
* Find all captured conversations, regardless of channels
* Filter and drill-down into conversation content based on performance data, metadata, keywords, and personal customer identifiers
* Review feedback survey data that customers submit
## Users & Capabilities
Insights Manager supports two main types of users: **Workforce Management Leaders** and **Business Stakeholders**.
| Workforce Management Leaders | Business Stakeholders |
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Who: Supervisors, Managers, and Front Line Leaders directly involved in the day-to-day management of individual or multiple contact centers. | Who: Business & CX Analysts, Program Managers, and Directors directly working with ASAPP teams to implement and optimize for business goals. |
| What: Managing agent staffing and contact center volume; Monitoring agent performance and customer satisfaction levels; Involved in coaching and quality management efforts. | What: Focused on optimizing for specific business goals; Creating and synthesizing data for end-to-end reporting; Detecting trends and improving customer experience insights. |
### Monitoring Capabilities
| | Workforce Management Leaders | Business Stakeholders |
| :----------------------------- | :--------------------------- | :-------------------- |
| Queue Groups & Personalization | ✓ | ✓ |
| Queue Performance | ✓ | ✓ |
| Agent Monitoring | ✓ | ✓ |
| CSAT Monitoring | ✓ | ✓ |
| Viewing Live Conversations | ✓ | - |
| Whisper | ✓ | - |
| High Queue Mitigation | - | ✓ |
| Chat Takeover | ✓ | - |
| Queue Overflow Routing | ✓ | - |
### Reporting Capabilities
| | Workforce Management Leaders | Business Stakeholders |
| :---------------------------- | :--------------------------- | :-------------------- |
| Core Historical Reports | ✓ | ✓ |
| Creating & Sharing Reports | ✓ | ✓ |
| Data Definitions / Dictionary | ✓ | ✓ |
| Viewing Conversations | ✓ | ✓ |
| Filters | ✓ | ✓ |
| Notes | ✓ | ✓ |
| Search | ✓ | ✓ |
| Export | ✓ | ✓ |
### Management Capabilities
| | Workforce Management Leaders | Business Stakeholders |
| :------------- | :--------------------------- | :-------------------- |
| Business Hours | ✓ | - |
| Users | ✓ | - |
# Live Insights Overview
Source: https://docs.asapp.com/agent-desk/insights-manager/live-insights
Learn how to use Live Insights to monitor and analyze real-time contact center activity.
Live Insights provides tools to track agent and conversation performance in real time. You can:
* Monitor all queues
* Monitor alerts
* Drill down into each queue to gain insight into what areas need attention
1. The Overview page (All Queues) shows a summary widget for each configured queue.
2. Click a **queue tile** or select a **queue** from the header dropdown to navigate to the Queue Details page.
## Monitor Performance per Queue
The Queue Details page for each queue shows performance across the most important metrics.
All metrics that the dashboard displays update in true real time. You can categorize metrics either as "Right Now" or "Current Period":
* Right Now metrics update immediately upon a change in the ecosystem.
* Current Period metrics will constantly update in aggregate over the day.
## Information Architecture
ASAPP continues to improve the Live Insights experience with new touch points to host live transcripts and to scale up when introducing new metrics and performance signals.
1. **All Queues** → Provides a performance overview of all queues and queue groups. Also provides customization tools to show/hide queues and create/manage queue groups.
2. **Single Queue and Queue Groups** → These now include two pages:
* **Conversations:** Displays performance data for all conversations currently connected to an agent, as well as live transcripts and alerts.
* **Performance:** Displays queue performance data, both for 'right now' and rolling 'since 12 am'. It also provides agent performance data and showcases feedback that customers send.
### Two Views: Conversations & Performance
**Conversations:**
Displays performance data for all conversations currently connected to an agent, as well as live transcripts and alerts.
**Performance:**
Displays queue performance data, both for 'right now' and rolling 'since 12 am'. It also provides agent performance data and showcases feedback that customers send.
# Agent Performance
Source: https://docs.asapp.com/agent-desk/insights-manager/live-insights/agent-performance
Monitor agent performance in Live Insights.
ASAPP provides robust real-time agent performance data. You can monitor:
* Agent status
* Handle and response time performance
* Agent utilization
In addition, alerts and signals provide context to better understand how agents are performing.
## How to Access Agent Data
You can access agent performance data from the 'Performance' page.
1. **Open agent panel**: To view agent performance data, click the **Agent** icon on the right-side of the screen. The system opens a panel that contains a list of all agents currently logged into the queue.
2. **Close agent panel**: To close the agent panel, click the **close** icon.
## Agent Real-time Performance Data
Live Insights automatically updates performance data related to agents in real-time every 15 seconds.
## Search for Agents & Sort Data
ASAPP provides tools to organize and find the right content. You can search for a specific agent name or sort the data based on current performance.
1. **Find agents**: To find a specific agent, enter the **agent name** in the search field. The list of agents will filter down to the relevant results. To remove the query, delete the **agent name** from the search field.
2. **Sort agents**: You can use each column in the agent panel to sort content. Default: the system sorts the list by agent name. To sort by a different metric, click the **column name**. To change the sort order, click the **active column name**.
## View Agent Transcripts
You can access live agent transcripts from the 'Agent' panel.
1. **Agents with assignments**: The system underlines agents currently taking assignments in the 'Agent' panel. Click an **underlined agent name** to go to the 'Conversation' page to view relevant agent transcripts.
2. **Agent filter applied**: When you view an agent's transcript, the 'Conversation Activity' table displays only their chats. The filter chip displayed above the list of conversations indicates this filtering. To remove the filter, click the **X** icon in the filter chip.
# Alerts, Signals & Mitigation
Source: https://docs.asapp.com/agent-desk/insights-manager/live-insights/alerts,-signals---mitigation
Use alerts, signals, and mitigation measures to improve agent task efficiency.
To improve user focus and task efficiency, ASAPP elevates various alerts and signals within Live Insights.
These alerts notify users when performance is degrading, when the system detects events, or when high queue mitigation measures can be activated based on volume.
## Type of Alerts
Live Insights displays four alert types:
1. **Metric Highlighting**: Highlights metrics that are above their target threshold within Live Insights. The system shows the highlights on the Overview page, as well as within single queues and queue groups. The alert will persist until the metric's performance returns below its threshold.
2. **Event-based Alerts**: Detects and records events per conversation and displays them in the conversation activity table.
3. **High Queue Mitigation**: Activates when the queue volume exceeds the target threshold. When active, you can use mitigation measures to reduce queue volume impacts.
4. **High Effort Issue**: Indicates when a high effort issue is awaiting assignment and is currently blocking other issues from being assigned.
## Metric Highlighting
Live Insights highlights metrics that are above their target threshold on the Overview page, as well as within single queues and queue groups.
The alert persists until the metric's performance returns below its threshold.
Where metrics are highlighted:
1. **Conversation performance**: The system can highlight both 'average handle time' and 'average response time'.
2. **Agent performance**: 'Time in status', 'average handle time', and 'average response time'.
3. **Queue performance**: The system can highlight queue-level metrics within a single queue, queue groups, or on the Overview page.
## Event-based Alerts
Agents, customers, or you generate events from actions taken.
Live Insights detects and records these events and displays them alongside conversation data, within the 'alert' column.
1. **Conversation events**: These events are related to a unique conversation. Agent actions or your actions can generate the events.
* **Customer transfers**: When an agent transfers a customer, Live Insights displays an alert next to the conversation.
* **Whisper sent**: When you send a whisper message to an agent, Live Insights records and displays the event next to the conversation.
2. **Agent events**: These events impact the agent workload and help you contextualize agent performance. Live Insights displays the events for all targeted agents, within the Agent Performance panel.
* **High effort**: Agents that are currently handling a high effort issue.
* **Flex concurrency**: The agent is currently flexed and has a higher than normal utilization.
## High Queue Mitigation
ASAPP provides tools to enable workforce management groups to act fast when queues are or could be anomalously high.
**Tools Overview**
Live Insights can:
* Monitor queue volume for unusually high volume.
* Highlight 'Queued' metric based on severity level.
* Activate 'Custom High Wait Time' messaging and replace Estimated Wait Time messaging.
* Pause queues experiencing extremely high volume and prevent new queue assignments.
**Volume Thresholds:**
Live Insights highlights metrics when they reach past a threshold defined for the queue.
1. **Low Severity:** detects abnormal activity and has moderate impact on the queue.
2. **High Severity**: detects highly abnormal activity. The queue is severely impacted.
**Mitigation Options:**
Mitigation
Severity Threshold
Features available
Default behavior
Business as usual. All queues are operating based on this setting.
None
Estimated Wait Time messaging is active.
Routing & assignment rules remain unchanged.
Custom High Wait Time Message
Low severity mitigation measure. Replaces Estimated Wait Time messaging.
Low Severity
The system replaces Estimated Wait Time messaging with a custom message.
Routing & assignment rules remain unchanged.
Pausing the Queue
High severity mitigation measure. Prevents new assignments to the queue.
High Severity
Estimated Wait Time messaging is replaced with a custom message alerting users the queue is currently closed due to high volume.
The system pauses assignment to the queue.
Users currently in the queue remain in the queue.
To time out users waiting in the queue, please contact ASAPP.
### Activate Mitigation
1. **Mitigation menu options**: When available, Live Insights displays a menu on the relevant queue card in the Overview, as well as on the 'Performance' page of single queues and queue groups. To view those options, click the **menu** icon. The menu icon only displays when you highlight 'Queued'.
2. **Select mitigation**: Based on the severity level, Live Insights displays different mitigation options. Select an **option** to activate it. To remove the mitigation behavior, select **Default behavior**.
3. **Mitigation applied**: When you select a mitigation option, the system indicates it on the queue card or on the Performance page.
## High Effort Issues
ASAPP supports a capability to enable agent focus for higher effort issues, while maintaining efficiency.
This feature dynamically adjusts how many concurrent issues an agent should handle while assigned a high effort issue.
### What is a High Effort Issue
ASAPP will route customers based on the expected effort of their issue. All issues, by default, will have an effort of 1.
Any issue with an effort value greater than 1 becomes "high effort". Reach out to your ASAPP Implementation team to configure high effort rules for your program.
## Feature Definition
* **Slot**: A slot represents a space for a chat to be assigned to an agent. You can assign and configure multiple slots to a single agent via User Management.
* **Effort**: Effort represents what is needed from an agent to solve an issue. For each effort point assigned to an issue, an agent must have an equivalent number of available slots to be assigned that issue. ASAPP determines an issue's effort by its relevant customer attributes.
* **High Effort Time Threshold**: A threshold that sets how much time an agent can parallelize a high effort issue with other issues. You can configure this threshold per queue. This threshold represents the duration of all existing assignments an agent is handling when a high effort issue is next in line.
* **Flex Slot**: All agents have 1 additional slot that can be used if they are eligible to receive a flex assignment or if they are temporarily over-effort when handling a high effort issue.
* **Linear Utilization Level:** A type of Linear Utilization relative to the number of assignments an agent has assigned at a given time, regardless of the assignment workload state.
* **Assignment Workload**: A measure of Linear Workload relative to the number of active assignments an agent has assigned at a given time. An assignment is not considered active if it has caused an agent to become Flex Eligible.
* **Effort Workload**: A measure of Linear Workload relative to the issue effort of all active assignments an agent has assigned at a given time.
### How are high effort issues prioritized and assigned?
ASAPP assigns high effort chats in the order that they entered the queue. You can prioritize high effort chats higher in the queue using customer attributes. This prioritization is optional and not required. A configurable *high effort time threshold* allows each queue to set how much time an agent can parallelize a high effort issue with other assignments.
### How are high effort issues assigned against other issues?
ASAPP assigns high effort issues in order of configured priority and when they entered the queue. An agent will receive a high effort assignment if they meet at least 1 of the following criteria:
* An agent has 0 active assignments.
* An agent has sufficient open slots to receive a high effort assignment.
* The **high effort time threshold** has elapsed for all of an agent's current assignments and the high effort chat's effort would not extend the agent's Effort Workload past their Flex Slot.
### How do high effort issues impact performance?
* High effort issues will not change current behavior for Queue Priority.
* High effort issues will not change current behavior for Flex Eligibility or Flex Protect.
* High effort issues take longer to assign because they have to wait for an agent to have sufficient effort capacity.
* If a set of queues has 50% or more agents in common, then a high effort issue at the front of one queue will hold the issues in the other "shared" queues until it is assigned.
### How do I monitor the impact of high effort issues?
You can view the 'Queued - High Effort' metric in Live Insights on queue detail pages. This metric captures the number of high effort issues currently waiting in the queue. If a high effort issue is first in queue and slows other issues from being assigned, Live Insights displays an alert on this metric. These changes will also be visible for programs that do not have high effort rules configured.
### How can I tell which agents are handling high effort issues?
In the Agent Right Rail, you can monitor which agents are currently handling high effort issues. ASAPP displays an icon next to the agent's utilization indicating a high effort issue is assigned. These changes will also be visible for programs that do not have high effort rules configured.
# Customer Feedback
Source: https://docs.asapp.com/agent-desk/insights-manager/live-insights/customer-feedback
Learn how to view customer feedback in Live Insights.
Live Insights tracks customers that engage with the satisfaction survey.
The Customer Feedback panel displays all feedback received throughout the day.
## Access Customer Feedback
1. **Open feedback panel**: To view feedback, click the **Feedback** icon on the right side of the 'Performance' page. The system opens the Customer Feedback panel.
2. **Time stamp**: Indicates when the system recorded the feedback.
3. **Agent name and issue ID**: Indicates the targeted agent, as well as the customer's issue ID.
* **Issue ID link**: Click the **issue ID** to display the transcript in the Conversation Manager.
4. **Feedback**: Feedback that the customer left.
5. **CSAT**: CSAT score that the system calculates based on customer responses to the survey.
6. **Find agent**: You can filter the feedback received by agent. To view feedback related to a specific agent, type the **agent name** in the search field.
# Live Conversations Data
Source: https://docs.asapp.com/agent-desk/insights-manager/live-insights/live-conversations-data
Learn how to view and interact with live conversations in Live Insights.
You can find all conversations that are currently connected to an agent in Live Insights.
Performance data updates automatically in Live Insights. If a conversation's metrics are outside their target range, the system displays alerts.
## Conversation Activity
The conversation activity table is the bread and butter of real-time monitoring.
You can see all conversations currently assigned to an agent. You can sort content by performance metrics to provide you with the view that is most relevant to your needs. Live Insights automatically refreshes performance data every 15 seconds.
Furthermore, you can access live transcripts for each conversation currently assigned.
1. **Links**: Provides a quick entry point to view historical transcripts or performance data.
2. **Conversation count & refresh**: Displays the total conversations displayed in the table. Live Insights updates the content automatically every 15 seconds.
3. **Sorting**: You can sort the content by each of the metrics captured for each conversation. You can sort all columns in ascending/descending order. To sort, click the **column header**. Click the **header** again to reverse the sorting order. Default: Ascending by time assigned.
4. **Conversations**: Each conversation currently assigned to an agent displays as a row in the Conversation Activity table. Metrics associated with the conversation display and update dynamically.
5. **Metric highlighting**: Metrics that have assigned thresholds are highlighted. See 'Metrics Highlighting' for more information.
6. **Alerts**: When an event is recorded, it displays in the column. Not all conversations will include an event.
See [Alerts, Signals & Mitigation](/agent-desk/insights-manager/live-insights/alerts,-signals---mitigation "Alerts, Signals & Mitigation") for more information.
## Conversation Data Anatomy
Each row in the conversation activity table lists performance data.
The chart below outlines data available in Live Insights for each chat conversation.
1. **Issue ID**: Unique conversation identifier that the system assigns to a customer intent.
2. **Agent name**: Name of the agent handling the conversation.
3. **Channel**: Detected channel the customer is engaging with.
4. **Intent**: Last detected intent before the system assigns the user to the queue.
5. **Time Assigned**: Time when the system assigned the conversation to an agent.
6. **Handle time**: Current handle time of the conversation.
7. **Average Response Time**: Average time it takes an agent to reply to customer utterances.
8. **Time Waiting**: Time since the last message that the sender has been waiting for a response.
9. **Alerts**: Event-based signals recorded throughout the conversation.
10. **Queue name**: Name of the queue that received the issue assignment. This feature only displays in Queue Groups. Click the **queue name** to go to the queue details view.
## View a Live Transcript
Each conversation connected to an agent includes a live transcript that you can view.
The transcript updates in real time. You can send a Whisper to the agent from the transcript.
1. **Open transcripts**: To view a transcript, click any **row** in the Conversation Activity table.
2. **Transcript**: The transcript updates in real time. The system displays handle time alongside conversation data (issue ID, agent, channel and intent).
3. **Close transcripts:** To close a transcript, click the **Close** icon.
4. **Whisper**: A Whisper allows you to send a discrete message within the transcript that agents can see but that the system hides from customers.
## Conversations: Current Performance Data
Current queue performance data appears to the right of the activity table.
These metrics encompass all conversations currently in the queue or connected to an agent.
You can view a drill-down, enhanced view of the performance data under the Performance page.
1. **Queue Activity**: Includes 'Queued', 'Avg current time in queue', 'Average wait time', and 'Average time to assign'.
2. **Volume**: Includes 'Offered', 'Assigned to agent', and 'Time out by agent'.
3. **Handle & Response Time**: Includes 'Average handle time (AHT)', 'Average response time (ART)', and 'Average first response time (AFRT)'
# Metric Definitions
Source: https://docs.asapp.com/agent-desk/insights-manager/live-insights/metric-definitions
Learn about the metrics available in Live Insights.
## Performance - 'Right Now' Metrics
| **Metric name** | **Definition** |
| :------------------------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Offered** | The number of conversations that are currently connected with an agent or waiting in the queue. |
| **Assigned to Agent** | The number of conversations where a customer is currently talking to a live agent. |
| **Timed out by Agent** | Only available as a current period metric for the day. |
| **Queued** | The number of customers who are waiting in the queue to be connected to an agent. |
| **Queued - Eligible for Assignment** | The number of customers who are waiting in the queue, received a check-in message, and replied to it. |
| **Max Queue Time** | The actual wait time of the customer who is positioned last in the given queue. |
| **Average Wait Time** | The average queue time for all customers who are currently assigned to an agent or waiting in the queue, including 'zero-time' for customers directly assigned to an agent when there were available slots. |
| **Average Time in Queue** | The average queue time for all customers who are currently waiting in the queue. |
| **Average Time to Assign** | The average queue time for all customers who are currently assigned to an agent, including 'zero-time' for customers directly assigned to an agent when there were available slots. |
| **Queue Abandons** | Only available as a current period metric for the day. |
| **Average Abandon Queue Time** | Only available as a current period metric for the day. |
| **Queue Abandonment Rate** | Only available as a current period metric for the day. |
| **Average Agent Response Time** | The average amount of time to respond to a customer message across the assignment for agents who are currently handling chats. |
| **Average Agent First Response Time** | The average amount of time to send the first line to a customer after the chat was assigned for agents who are currently handling chats. |
| **Average Handle Time** | The time spent across all current chats by an agent per assignment starting from when the chat was assigned to when it is dispositioned. |
| **Active Slots** | A ratio of the number of currently active conversations to number of concurrent slots for agents who are in an Active status or actively handling chats. |
| **Occupancy** | The percentage of currently assigned chats to the number of agents with slots set to active. |
| **Concurrency** | The percentage of currently assigned chats to the number of agents with currently assigned chats. |
| **Logged In Agents** | The number of agents currently logged in to Agent Desk. |
| **Active and Away Agents** | The number of agents with an active-type and away-type label respectively. |
| **Agent Status** | The number of agents with each status label. |
## Agent Metrics
| **Metric name** | **Definition** |
| :------------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Agent Name** | Name of the agent currently logged in to Agent Desk. Agents currently handling assignments have their names underlined. When you click, the system displays the agent's current assignments in the 'Conversations' tab. |
| **Agent Status** | Name of the status selected by the agent in Agent Desk. Green labels represent Available statuses, while orange labels represent Away statuses. |
| **Time in Status** | The time an agent has spent in the currently displayed status. |
| **Average Handle time** | The time spent across all current assignments, starting from when the chat was assigned to when it is dispositioned, for a given agent. |
| **Average Response Time** | The average amount of time to respond to a customer message across all current assignments for a given agent. |
| **Assignments** | The number of assignments an agent is currently handling. |
## Conversation Metrics
| **Metric name** | **Definition** |
| :------------------------ | :------------------------------------------------------------------------------------------------ |
| **Issue ID** | Unique conversation identifier that the system assigns to a customer intent. |
| **Agent Name** | Name of the agent handling the conversation. |
| **Channel** | Channel the customer is engaging with. |
| **Intent** | Last detected intent before the system assigns the user to the queue. |
| **Queue Membership** | Queue where the system assigned the issue based on intent classification and queue routing rules. |
| **Time Assigned** | Time when the system assigned the conversation to an agent. |
| **Handle Time** | Current handle time of the conversation. |
| **Average Response Time** | Average time it takes an agent to reply to customer utterances. |
| **Time Waiting** | Time since the last message sender awaits a response. |
| **Alerts** | Event-based signals that the system records throughout the conversation. |
## Performance - 'Current Period' Metrics (since 12 am)
| **Metric name** | **Definition** |
| :------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Offered - Total** | The total instances where the conversation was either placed in queue or assigned directly to an agent attributed to the time interval the Queue or direct Assignment event (without being placed in queue) occurs. |
| **Assigned to Agent - Total** | The total instances where the customer was assigned to an agent. |
| **Timed Out by Agent - Total** | The total instances assigned to an agent where they "Timed Out" the customer. |
| **Queued - Total** | The total instances where a customer was placed in or is currently waiting in the queue to be connected to an agent. |
| **Queued - Eligible for Assignment** | Only available as a right now metric. |
| **Max Queue Time** | Only available as a right now metric. |
| **Average Wait Time** | The average time a customer waited to abandon or be assigned to an agent, including 'zero-time' for customers directly assigned to an agent when there were available slots. |
| **Average Time in Queue** | The average time a customer waited in queue for those who either abandoned the queue or were assigned to an agent. |
| **Average Time to Assign** | The average queue time for all customers who were assigned to an agent, including 'zero-time' for customers directly assigned to an agent when there were available slots. |
| **Queue Abandons** | The total count of customers who abandoned the queue. |
| **Average Abandon Queue Time** | The average time a customer waited in queue prior to abandoning, either by being dequeued on the web or ending the chat before being assigned to an agent. |
| **Queue Abandonment Rate** | The percent of customers who required a visit to the queue and abandoned before being assigned to an agent. |
| **Average Agent Response Time** | The average amount of time it takes an agent to respond to a customer message across all assignments. |
| **Average Agent First Response Time** | The average amount of time it takes an agent to send the first line to a customer after the chat was assigned across all assignments. |
| **Average Handle Time** | The average amount of time spent by an agent per assignment, from when the chat was assigned to when the agent finishes dispositioning the assignment. |
| **Active Slots** | Only available as a right now metric. |
| **Occupancy** | The percentage of cumulative utilization time to cumulative available time for all agents who handled chats. |
| **Concurrency** | The weighted average number of concurrent chats that agents are handling at once, given an agent is utilized by handling at least one chat. |
| **Logged In Agents** | Only available as a right now metric. |
| **Active and Away Agents** | Only available as a right now metric. |
| **Agent Status** | Only available as a right now metric. |
## Teams and Locations
You can track the live behaviors of agents by overseeing outages and staff levels at different geographic locations. Furthermore, each team provides hourly updates as to who is active/lunch etc and they want to be able to get this information easily.
Admins see a list of agents when they click into a particular queue and select Performance from the left-hand panel and clicked into the Agents icon on the right-hand panel. Admins can further oversee results by performance metrics of the current day and filter both the agent list and metrics by any of the following attributes:
* **Agent Name**
* **Location**
* **Team**
* **Status**
### Team Table
Admins can filter teams by type of role and review each company assigned to the team. Also, each result shows the size and the occupancy of each team.
Each administrator can provide an hourly update of how many agents are active, on lunch, or in a different state as well as view corresponding metrics.
### Location Table
Admins can filter locations by region and review the occupancy and size of each location.
Each location provides updates of performance and agent names.
# Navigation
Source: https://docs.asapp.com/agent-desk/insights-manager/live-insights/navigation
Learn how to navigate the Live Insights interface.
## How to Access Live Insights
* You can access Live Insights from the primary navigation. To open, click the **Live Insights** link.
## How to Access a Queue or Queue Group
Live Insights provides different views of queue performance data:
* Overview of all queue activity, including queue groups and organizational groups.
* Single queue and queue groups, which display queue and agent performance data.
You can access a single queue or queue group in two ways:
1. From Overview, **click a tile** → the system opens the relevant queue details page.
2. From the **queue dropdown**, select a **queue** or **queue group**.
## Navigate Away from a Single Queue or Queue Group
You can navigate back to the Live Insights Overview, or to a different queue or queue group.
1. **Back arrow**: when you click, the system opens the Live Insights Overview.
2. **Queue channel indicator**: indicates if the queue is a voice or chat queue.
3. **Queue dropdown**: when you click, you can select a different queue or queue group.
## Channel-based Queues
Queues and queue groups host channel-specific content. ASAPP supports three queue types:
1. **Chat queues**: includes all digital channels such as Apple Messages for Business, Web, SMS, iOS and Android.
2. **Voice queues**: includes all voice channels in one queue.
3. **Queue groups**: groups consist of aggregated queues of a single type. Each group contains either chat queues or voice queues. The number of queues in the queue group displays below the channel icon.
## Access Queue Performance and Conversation Data
Single queues and queue groups include two views: performance data about the queue and conversation activity data.
1. **Performance**: Click to access the performance data of the queue, as well as agent performance data and customer feedback.
2. **Conversations**: Click to access conversation activity, view transcripts, and send whisper messages.
# Performance Data
Source: https://docs.asapp.com/agent-desk/insights-manager/live-insights/performance-data
Learn how to view performance data in Live Insights.
Live Insights provides a comprehensive view of today's performance within each queue and queue group.
You can view performance data for 'right now', as well as for the 'current period', defined as since 12 am. You can also view alerts, signals, and agent performance data on the Performance page.
1. **Data definitions**: On click, opens a link to view metric definitions within Historical Reporting.
2. **Channel filter**: Filter performance data by channel. When you click, the system displays channel options. Select options to automatically filter data.
3. **Performance metrics**: Displays all performance metrics currently available. By default, the system shows performance metrics in a 'Right Now' view.
4. **Intraday**: Rolling data since the beginning of the day (12 am) is available upon activation. When active, the system displays the rolling count or averages since 12 am.
5. **Agent metrics and feedback data**: When you click, the system shows the Agent performance data or customer feedback received.
## Intraday Data
You can view current performance data ('right now') or view aggregate counts and averages since the beginning of the day ('current period').
These two views provide you with a fuller picture of queue performance and facilitate investigations and contextualization of events.
1. **Right Now**: Default view. Provides performance data currently captured.
2. **Since 12 am**: Click the **toggle** to display 'current period' metrics.
The system does not provide some metrics in this configuration.
See Metrics Definitions for more information
## Filter by Channel
You can segment performance data per channel or by groups of channels.
1. **Channel dropdown**: To filter data per channel, click the **channel** dropdown to activate channel selection.
2. **Channel options**: The channel dropdown shows all available channels. You can select one or more **channels** to filter data by. Once selected, the data will automatically update.
# Queue Overview (All Queues)
Source: https://docs.asapp.com/agent-desk/insights-manager/live-insights/queue-overview--all-queues-
Learn how to view and customize the performance overview for all queues and queue groups.
Live Insights provides a view of all single queues and queue groups, with a performance overview.
Live Insights highlights metrics that are outside the normal performance range. You can also find customization tools to show/hide queues, or to create and manage queue groups on this page.
1. **Queue count**: Displays the total number of queues available.
2. **Customization**: Users can access tools to customize the display of queues.
* Queue visibility: Show/hide queues to customize the Overview page
* Queue groups: Create new queue groups, edit existing groups.
3. **Single Queues & Queue groups**: Displays performance overview for each queue and queue groups. Each tile leads to a drilled down view.
## Customization
ASAPP supports customization features to change the display of queues, as well as create and manage queue groupings.
To access customization features: click the **Customize** button on the Overview page. Two options appear. Click an **option** to launch the associated customization feature.
## Change Queue Visibility
ASAPP provides tools for you to customize the queues showcased on the Overview page. You can hide Queues based on customization needs.
Click the **Customize** button on the All Queues page to sort and select the **queues** to display.
1. **Find a queue**: Use the search field to find a specific queue. Type in the **queue name** to filter the list of queues down to relevant matches.
2. **Sort queues**: You can sort in ascending or descending order. Click the **Sort** dropdown to select the desired sort order.
3. **Bulk selection**: To select all queues, or deselect all queues, click the **bulk selection feature** to view all queues. Click again to deselect all queues.
4. **Single queue selection**: Select and deselect **queues** in the list. The system hides deselected queues on the Overview page.
5. **Apply and cancel**: To confirm your selection, click **Apply**. To dismiss changes or close the modal, select **Cancel**.
## Create and Edit Queue Groups
You can create groups of queues to more efficiently monitor performance across multiple queues. When you create a queue group, the system displays a drill-down view of the queue group.
A queue group behaves similarly to a single queue: you get access to all live transcripts across all queues selected in the group.
You can access Performance data for all agents in the group, as well as consolidated customer feedback.
Queue groups are unique to each user. You can edit and create an unlimited number of queue groups.
1. **Create new group**: Click this **button** to create a new queue group.
2. **Existing queue group**: You can view, edit or delete them.
3. **Organizational group**: Your organization creates queue groups that display with a 'Preset' tag. Queues with this tag are visible by all Live Insights users. These groups cannot be edited or deleted.
4. **Edit a group**: To edit an existing queue group, click the **Edit** icon.
5. **Delete a group**: To delete an existing queue group, click the **Delete** icon.
**Edit a queue group:**
1. **Queue group name**: Name assigned to the queue group.
2. **Available queues**: List of all queues that you can add to a group. Select **queues** to add the queues to the group, and vice versa.
3. **Queues added to group**: The system displays currently selected queues under the queue name.
4. **Apply and cancel**: To apply changes, click the **Apply** button. To dismiss changes or close the modal, click the **Cancel** button.
## Overflow Queue Routing
Overflow Queue Routing enables administrators to redirect traffic from one queue to another to reduce estimated wait times for end-customers and support closed queues when it is a legal requirement.
Overflow Queue Routing can use two rules:
1. **Business Hours Rule**: The system redirects traffic from Queue A to Queue B when it is outside the operating business hours for Queue B.
2. **Agent Availability Rule**: The system redirects traffic from Queue A to Queue B when there are no available agents serving Queue A.
Work with your ASAPP account team to configure overflow routing rules that align with your business needs.
## Bulk Close and Transfer Chats
ASAPP provides capabilities to bulk close and transfer chats in Live Insights to help manage queues experiencing unusual activity or high traffic.
### Bulk Chat Transfer
To transfer all chats from one queue to another:
1. Click the dropdown menu in the queue card
2. Select "Transfer all chats"
3. The system displays a queue selection modal asking "Select the queue which you want to transfer all chats to?"
4. Select the target queue from the dropdown list
5. Click "Transfer chats" to complete the action
The system will display a toast message confirming that all chats have been transferred. The end customer will not see any change on their side and will assume they are still waiting in a queue.
### Bulk Chat Closure
To close all chats in a queue:
1. Click the 3 dots in the upper right-hand corner of the queue card
2. Select "End all chats" from the dropdown menu
3. The system displays a confirmation modal asking "Are you sure you want to end all chats in this queue?"
4. Click "Confirm" or "Yes" to complete the action
Use these features carefully as they affect multiple customer conversations simultaneously. Bulk actions are best used in situations where immediate intervention is needed to manage queue performance or address unusual activity.
# Integration Channels
Source: https://docs.asapp.com/agent-desk/integrations
Learn about the channels and integrations available for ASAPP Messaging.
ASAPP Messaging offers a wide range of integration options to connect your brand with customers across various channels and enhance your customer service capabilities.
These integrations are divided into two main categories: [Customer Channels](#customer-channels) and [Applications Integrations](#applications-integrations).
**Customer Channels** are the direct touchpoints where your customers can interact with your brand.
Regardless of which channels you choose to integrate, [Digital Agent Desk](/agent-desk/digital-agent-desk) standardizes the interaction for your agents into a single interface.
**Applications Integrations** enhance the functionality and efficiency of your customer service operations. These integrations cover various aspects such as agent authentication, routing, knowledge management, and user management.
## Customer Channels
## Applications Integrations
# Android SDK Overview
Source: https://docs.asapp.com/agent-desk/integrations/android-sdk
Learn how to integrate the ASAPP Android SDK into your application.
You can integrate ASAPP's Android SDK into your application to provide a seamless messaging experience for your Android customers.
### Android Requirements
ASAPP supports Android 5.0 (API level 21) and up. The SDK currently targets API level 30.
ASAPP distributes the library via a Maven repository and you can import it with Gradle. ASAPP wrote the SDK in Kotlin. You can also use it if you developed your application in Java.
## Getting Started
To get started with Android SDK, you need to:
1. [Gather Required Information](#1-gather-required-information "1. Gather Required Information")
2. [Install the SDK](#2-install-the-sdk "2. Install the SDK")
3. [Configure the SDK](#3-configure-the-sdk "3. Configure the SDK")
4. [Open Chat](#4-open-chat "4. Open Chat")
### 1. Gather Required Information
Before downloading and installing the SDK, please make sure you have the following information. Contact your Implementation Manager at ASAPP if you have any questions.
| | |
| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| App ID | Also known as the "Company Marker", assigned by ASAPP. |
| API Host Name | The fully-qualified domain name used by the SDK to communicate with ASAPP's API. Provided by ASAPP and subject to change based on the stage of implementation. |
| Region Code | The ISO 3166-1 alpha-2 code for the region of the implementation, provided by ASAPP. |
| Supported Languages | Your app's supported languages, in order of preference, as an array of language tag strings. Strings can be in the format "\{ISO 639-1 Code}-\{ISO 3166-1 Code}" or "\{ISO 639-1 Code}", such as "en-us" or "en". Defaults to \["en"]. |
| Client Secret | This can be an empty or random string\* until otherwise notified by ASAPP. |
| User Identifier | A username or similar value used to identify and authenticate the customer, provided by the Customer Company. |
| Authentication Token | A password-equivalent value, which may or may not expire, used to authenticate the customer that is provided by the Customer Company. |
\* In the future, the ASAPP-provided client secret will be a string that authorizes the integrated SDK to call the ASAPP API in production. ASAPP recommends fetching this string from a server and storing it securely using Secure Storage; however, as it is one of many layers of security, you can hard-code the client secret.
### 2. Install the SDK
ASAPP distributes the library via a Maven repository and you can import it with Gradle. First, add the ASAPP Maven repository to the top-level `build.gradle` file of your project:
```groovy theme={null}
repositories {
maven {
url "https://packages.asapp.com/chat/sdk/android"
}
}
```
Then, add the SDK to your application dependencies:
`implementation 'com.asapp.chatsdk:chat-sdk:'`
Please check the latest Chat SDK version in the [repository](https://gitlab.com/asappinc/public/mobile-sdk/android/-/packages) or [release notes](https://docs-sdk.asapp.com/api/chatsdk/android/releasenotes/).
At this point, sync and rebuild your project to make sure you have successfully imported all dependencies. You can also validate the authenticity of the downloaded dependency by following these steps.
### Validate Android SDK Authenticity
You can verify the authenticity of the SDK and make sure that ASAPP generated the binary. The GPG signature is the standard way ASAPP handles Java binaries when this is a requirement.
#### Setup
First, download the ASAPP public key [from here](https://docs-sdk.asapp.com/api/chatsdk/android/security/asapp_public.gpg).
```json theme={null}
wget -O asapp_public_key.asc https://docs-sdk.asapp.com/api/chatsdk/android/security/asapp_public.gpg
```
#### Verify File Signature
Use the console GPG command to import the key:
```json theme={null}
gpg --import asapp_public_key.asc
```
You can verify that the public key was imported via `gpg --list-keys`.
Download the ASC file directly from [our repository](https://gitlab.com/asappinc/public/mobile-sdk/android/-/packages). Finally, you can verify the Chat SDK AAR and associated ASC files like so:
```json theme={null}
gpg --verify chat-sdk-.aar.asc chat-sdk-.aar
```
### 3. Configure the SDK
Use the code below to create a configuration and initialize the SDK with it. You must pass your `Application` instance.
Refer to the aforementioned [required information](/agent-desk/integrations/ios-sdk/ios-quick-start). ASAPP recommends you initialize the SDK in your `Application.onCreate`.
```json theme={null}
import com.asapp.chatsdk.ASAPP
import com.asapp.chatsdk.ASAPPConfig
val asappConfig = ASAPPConfig(
appId = "my-app-id",
apiHostName = "my-hostname.test.asapp.com",
clientSecret = "my-secret",
enableSDKCrashlytics = true,
enableSentry = true)
ASAPP.init(application = this, config = asappConfig)
```
In case, you are facing compile issue after setting enableSDKCrashlytics to true, perform the following steps
1. Add (if not present) the following plugins to your app module's build.gradle.kts or build.gradle:
* id("com.google.gms.google-services")
* id("com.google.firebase.crashlytics")
2. Add (if not present) the Firebase BOM to your app's dependencies block:"
* implementation(platform("com.google.firebase:firebase-bom:29.0.0"))
3. Create a dummy google-services.json and place it in location: \$APP\_DIR/google-services.json.
The SDK should only be initialized once and it is possible to update the configuration at runtime.
### 4. Open Chat
Once the SDK has been configured and initialized, you can open chat. To do so, use the `openChat(context: Context)` function which will start a new Activity:
```kotlin theme={null}
ASAPP.instance.openChat(context = this)
```
Once the chat interface is open, you should see an initial state similar to the one below:
## Next Steps
# Android SDK Release Notes
Source: https://docs.asapp.com/agent-desk/integrations/android-sdk/android-sdk-release-notes
The scrolling window below shows release notes for ASAPP's Android SDK.
This content may also be viewed as a stand-alone webpage here: [https://docs-sdk.asapp.com/api/chatsdk/android/releasenotes](https://docs-sdk.asapp.com/api/chatsdk/android/releasenotes)
# Customization
Source: https://docs.asapp.com/agent-desk/integrations/android-sdk/customization
## Styling
The SDK uses color attributes that you define in the ASAPP theme, as well as extra style configuration options that you set via the style configuration class.
### Themes
To customize the SDK theme, extend the default ASAPP theme in your `styles.xml` file:
```xml theme={null}
```
You must define your color variants for day and night in the appropriate resource files, unless night mode is disabled in your application.
ASAPP recommends starting by only customizing `asapp_primary` to be your brand's primary color, and adjusting other colors when necessary for accessibility. The system uses `asapp_primary` as the message bubble background in most buttons and other controls. The screenshot below shows the default theme (gray primary - center) and custom primary colors on the left and right.
There are two other colors you may consider customizing for accessibility or to achieve an exact match with your app's theme: `asapp_on_background` and `asapp_on_primary`. Other elements that might appear in front of the background use `asapp_on_background`. Text and other elements that appear in front of the primary color use `asapp_on_primary`.
### More Colors
Besides the colors used for [themes](#themes "Themes"), you can override specific colors in a number of categories: the toolbar, chat content, messages, and other elements. You can override all properties mentioned below in the `ASAPPTheme.Chat` style.
The status bar color is `asapp_status_bar` and toolbar colors are `asapp_toolbar` (background), `asapp_nav_button`, `asapp_nav_icon`, and `asapp_nav_text` (foreground).
**General chat content colors**
* `asapp_background`
* `asapp_separator_color`
* `asapp_control_tint`
* `asapp_control_secondary`
* `asapp_control_background`
* `asapp_success`
* `asapp_warning`
* `asapp_failure`
**Message colors**
* `asapp_messages_list_background`
* `asapp_chat_bubble_sent_text`
* `asapp_chat_bubble_sent_bg`
* `asapp_chat_bubble_reply_text`
* `asapp_chat_bubble_reply_bg`
### Text and Buttons
To customize fonts and colors for both text and buttons, use the `ASAPPCustomTextStyleHandler`. To set this optional handler use `ASAPPStyleConfig.setTextStyleHandler`. Use the given `ASAPPTextStyles`
object to:
* Set a new font family with `updateFonts`. If you set no new fonts, the system uses the default instead.
* Override font sizes, letter spacing, text colors, and text casing styles. You can also customize the font family for each text style individually, if needed.
* Override button colors for normal, highlighted and disabled states.
Example:
```kotlin theme={null}
ASAPP.instance.getStyleConfig()
.setTextStyleHandler { context, textStyles ->
val regular = Typeface.createFromAsset(context.assets, "fonts/NH-Regular.ttf")
val medium = Typeface.createFromAsset(context.assets, "fonts/Lato-Bold.ttf")
val black = Typeface.createFromAsset(context.assets, "fonts/Lato-Black.ttf")
textStyles.updateFonts(regular, medium, black)
textStyles.body.fontSize = 14f
val textHighlightColor = ContextCompat.getColor(context, R.color.my_text_hightlight_color)
textStyles.primaryButton.textHighlighted = textHighlightColor
}
```
See `ASAPPTextStyles` to see all overridable styles.
The system calls `setTextStyleHandler` when it creates an ASAPP activity. Use the given `Context` object if you access resources to make sure that all customization uses correct resource qualifiers.
For example: if a user is in chat and toggles Night Mode, the SDK automatically triggers an activity restart. Once the system creates the new activity, the SDK calls `setTextStyleHandler` with the new night/day context, which retrieves the correct color variants from your styles.
## Chat Header
The chat header (toolbar in the chat activity) has no content by default, but you can add text or icon using `ASAPPStyleConfig`.
### Text Title
To add text to the chat header, pass a String resource to `setChatActivityTitle`. By default, the system aligns the title to start. For example:
```kotlin theme={null}
ASAPP.instance.getStyleConfig()
.setChatActivityTitle(R.string.asapp_chat_title)
```
### Drawable Title
To add an icon to the chat header use: `setChatActivityToolbarLogo`. You can also center the header content by calling `setIsToolbarTitleOrIconCentered(true)`. For example:
```kotlin theme={null}
ASAPP.instance.getStyleConfig
.setChatActivityToolbarLogo(R.drawable.asapp_chat_icon)
.setIsToolbarTitleOrIconCentered(true)
```
Icons will have priority in the chat header. If you add both text and icon, the system uses only the icon.
## Dark Mode
Android 10 (API 29) introduced Dark Mode (a.k.a night mode, dark theme), with a system UI toggle that allows users to switch between light and dark modes. ASAPP recommends reading the [developer documentation](https://developer.android.com/guide/topics/ui/look-and-feel/darktheme) for more information.
The ASAPP SDK theme defines default colors using the system resource "default" and "night" qualifiers, so chat will react to changes to the system night mode setting.
The ASAPP SDK does not automatically convert any color or image assets in Dark Mode; you must define night variants for each custom asset as described in [Android >Styling>Theming](#themes "Customization").
### Disable or Force a Dark Mode Setting
To disable Dark Mode, or to force Dark Mode for Android API levels below 29, ASAPP recommends using the [AppCompatDelegate.setDefaultNightMode](https://developer.android.com/reference/androidx/appcompat/app/AppCompatDelegate#setDefaultNightMode\(int\)) AndroidX API. This function changes the night mode setting throughout the entire application session, which also includes ASAPP SDK activities.
For example, it is possible to use Dark Mode on Android API 21 with the following:
```kotlin theme={null}
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
```
## Atomic Customization
To customize the styles at an atomic level, you can use the `setAtomicViewStyleHandler` to update viewStyles. Customizing at the atomic level will **override any default style** that is being set on the UI views. Use it only if general styling is not sufficient, and you need further customization. This is optional, and in most cases, you won't need it. Use with caution.
```kotlin theme={null}
ASAPP.instance.getStyleConfig()
.setAtomicViewStyleHandler { context: Context, viewStyles: ASAPPCustomViewStyles ->
// Update viewStyles as needed
}
```
### Custom Theming Example
Following code snippet is an example of how to apply an atomic customized theme.
```kotlin theme={null}
private fun setCustomStyling() {
val orangeColor = "#ea7024"
ASAPP.instance.getStyleConfig(reset = true)
.setChatActivityToolbarLogo(0)
.setChatActivityTitle(R.string.asapp_toolbar_custom_title)
.setIsToolbarTitleOrIconCentered(true)
.setAtomicViewStyleHandler { context: Context, viewStyles: ASAPPCustomViewStyles ->
val iconWidthInDp = 24
val iconWidthInPx = (context.resources.displayMetrics.density * iconWidthInDp).toInt()
val customRegularTypeface = Typeface.createFromAsset(
context.assets,
"fonts/Lato-Regular.ttf"
)
val customMediumTypeface = Typeface.createFromAsset(
context.assets,
"fonts/Lato-Medium.ttf"
)
val customBoldTypeface = Typeface.createFromAsset(
context.assets,
"fonts/Lato-Bold.ttf"
)
with(viewStyles.connectionBar.success) {
container.backgroundColor = Color.GREEN
icon.src = R.drawable.nav_check_24px
primaryText.color = Color.RED
primaryText.typeface = customRegularTypeface
icon.src = R.drawable.nav_check_24px
icon.tintColor = ContextCompat.getColor(context, R.color.asapp_error_red)
icon.width = iconWidthInPx
}
with(viewStyles.connectionBar.warn) {
container.backgroundColor = Color.YELLOW
primaryText.color = Color.WHITE
primaryText.typeface = customMediumTypeface
}
with(viewStyles.connectionBar.error) {
container.backgroundColor = Color.RED
icon.src = R.drawable.asapp_img_icon_x
primaryText.fontSize = 18f
primaryText.typeface = customBoldTypeface
icon.tintColor = ContextCompat.getColor(context, R.color.asapp_error_red)
}
with(viewStyles.bottomSheetConfirmationDialog) {
confirmButtonBar.button.width = MATCH_PARENT
cancelButtonBar.button.width = MATCH_PARENT
confirmButtonBar.button.radius = Int.MAX_VALUE
cancelButtonBar.button.radius = Int.MAX_VALUE
confirmButtonBar.button.typeface = Typeface.DEFAULT_BOLD
confirmButtonBar.button.textNormal = Color.WHITE
confirmButtonBar.button.backgroundNormal = Color.DKGRAY
cancelButtonBar.button.typeface = Typeface.DEFAULT_BOLD
cancelButtonBar.button.textNormal = Color.DKGRAY
cancelButtonBar.button.backgroundNormal = Color.WHITE
cancelButtonBar.button.borderNormal = Color.DKGRAY
}
with(viewStyles.quickRepliesViewGroup) {
container.maxHeight = 600
}
viewStyles.titleBar = ASAPPCustomViewStyles.TitleBar.newInstance().apply {
primaryText.color = Color.DKGRAY
primaryText.fontSize = 14.0f
primaryText.typeface = Typeface.DEFAULT
icon.width = WRAP_CONTENT
actionBackButton.color = Color.parseColor(orangeColor)
actionMoreButton.color = Color.parseColor(orangeColor)
}
with(viewStyles.ewtBar) {
progressBar.visibility = View.VISIBLE
progressBar.progressColor = Color.parseColor("#eeeeee")
progressBar.backgroundColor = Color.parseColor(orangeColor)
btnLeave.textNormal = Color.parseColor("#006fd6")
txtEwtTitle.color = Color.DKGRAY
txtEwtTitle.fontSize = 16.0f
txtEwtValue.color = Color.DKGRAY
txtEwtValue.fontSize = 22.0f
}
with(viewStyles.chatComposerBar) {
btnSend.color = Color.parseColor(orangeColor)
}
}
}
```
### Customization Details
Support for the following customizations are available:
#### Send Button Color
```kotlin theme={null}
with(viewStyles.chatComposerBar) {
btnSend.color = Color.parseColor(orangeColor)
}
```
#### TitleBar customizations
```kotlin theme={null}
viewStyles.titleBar = ASAPPCustomViewStyles.TitleBar.newInstance().apply {
primaryText.color = Color.DKGRAY
primaryText.fontSize = 14.0f
primaryText.typeface = Typeface.DEFAULT
icon.width = WRAP_CONTENT
actionBackButton.color = Color.parseColor(orangeColor)
actionMoreButton.color = Color.parseColor(orangeColor)
}
```
#### Quick Reply Max Height
```kotlin theme={null}
with(viewStyles.quickRepliesViewGroup) {
// Using Dp
container.maxHeight = ASAPPStyleConfig.dpToPx(context, 600)
// Or Using Pixel
container.maxHeight = 600
}
```
#### Estimated Wait Time (EWT) Bar Customization
```kotlin theme={null}
with(viewStyles.ewtBar) {
progressBar.visibility = View.GONE // Or VISIBLE
progressBar.progressColor = Color.parseColor("#eeeeee")
progressBar.backgroundColor = Color.parseColor(orangeColor)
btnLeave.textNormal = Color.parseColor("#006fd6")
txtEwtTitle.color = Color.DKGRAY
txtEwtTitle.fontSize = 16.0f
txtEwtValue.color = Color.DKGRAY
txtEwtValue.fontSize = 22.0f
}
```
#### Connection Status Bar with customized Success/Warning/Error
```kotlin theme={null}
with(viewStyles.connectionBar.success) {
container.backgroundColor = Color.GREEN
icon.src = R.drawable.nav_check_24px
primaryText.color = Color.RED
primaryText.typeface = customRegularTypeface
icon.src = R.drawable.nav_check_24px
icon.tintColor = ContextCompat.getColor(context, R.color.asapp_error_red)
icon.width = iconWidthInPx
}
with(viewStyles.connectionBar.warn) {
container.backgroundColor = Color.YELLOW
primaryText.color = Color.WHITE
primaryText.typeface = customMediumTypeface
}
with(viewStyles.connectionBar.error) {
container.backgroundColor = Color.RED
icon.src = R.drawable.asapp_img_icon_x
primaryText.fontSize = 18f
primaryText.typeface = customBoldTypeface
icon.tintColor = ContextCompat.getColor(context, R.color.asapp_error_red)
}
```
#### Modal Button Styling Customization
```kotlin theme={null}
with(viewStyles.bottomSheetConfirmationDialog) {
confirmButtonBar.button.width = MATCH_PARENT
cancelButtonBar.button.width = MATCH_PARENT
confirmButtonBar.button.radius = Int.MAX_VALUE
cancelButtonBar.button.radius = Int.MAX_VALUE
confirmButtonBar.button.typeface = Typeface.DEFAULT_BOLD
confirmButtonBar.button.textNormal = Color.WHITE
confirmButtonBar.button.backgroundNormal = Color.DKGRAY
cancelButtonBar.button.typeface = Typeface.DEFAULT_BOLD
cancelButtonBar.button.textNormal = Color.DKGRAY
cancelButtonBar.button.backgroundNormal = Color.WHITE
cancelButtonBar.button.borderNormal = Color.DKGRAY
}
```
# Deep Links and Web Links
Source: https://docs.asapp.com/agent-desk/integrations/android-sdk/deep-links-and-web-links
## Handling Deep Links in Chat
Certain chat flows may present buttons that are deep links to another part of your app. To react to taps on these buttons, implement the `ASAPPDeepLinkHandler` interface:
```kotlin theme={null}
ASAPP.instance.deepLinkHandler = object : ASAPPDeepLinkHandler {
override fun handleASAPPDeepLink(deepLink: String, data: JSONObject?, activity: Activity) {
// Handle deep link.
}
}
```
ASAPP provides an `Activity` instance for convenience, in case you need to start a new activity. Please ask your Implementation Manager if you have questions regarding deep link names and data.
### Example: Parsing and Opening Deep Links in Your Activity
If your app receives deep links through an Intent, you can extract the parameters and forward them to the ASAPP SDK when you reopen a chat.
```kotlin theme={null}
object AppDeepLinkHelper {
fun getASAPPDeepLinkDataIfAny(context: Context, intent: Intent): Map? {
val uri = intent.data ?: return null
if (context.getString(R.string.app_deep_link_host) != uri.host) return null
val map = mutableMapOf()
uri.queryParameterNames
.map { key ->
val value = uri.getQueryParameter(key)
val name = if (key == "intentKey") "Code" else key
if (value != null) map[name] = value
}
return map
}
}
```
Then handle it in your activity:
```kotlin theme={null}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
...
handleIntent(intent) // Handle deep link if app is cold-started
}
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
handleIntent(intent) // Handle deep link if activity is reused
}
private fun handleIntent(intent: Intent) {
val deepLinkData = AppDeepLinkHelper.getASAPPDeepLinkDataIfAny(this, intent)
if (!deepLinkData.isNullOrEmpty()) {
APP.instance.openChat(this, asappIntent = deepLinkData)
} else {
openChatIfNotificationIntent(intent)
}
}
```
✅ Tip: This approach ensures your app only responds to deep links from the expected host, and safely maps query parameters into a format that openChat() can consume.
## Handling Web Links in Chat
Certain chat flows may present buttons that are web links. To react to taps on these buttons, implement the `ASAPPWebLinkHandler` interface:
```kotlin theme={null}
ASAPP.instance.webLinkHandler = object : ASAPPWebLinkHandler {
override fun handleASAPPWebLink(webLink: String, activity: Activity) {
// Handle web link.
}
}
```
If you don't implement the handler (see above), the ASAPP SDK will open the link utilizing the system default with `Intent.ACTION_VIEW`.
## Implementing Deep Links into Chat
### Getting Started
Please see the Android documentation on [Handling Android App Links](https://developer.android.com/training/app-links).
### Connecting the Pieces
Once you set up a custom URL scheme for your app and handle deep links into your application, you can start chat to pass any data payload that you extract from the link:
```json theme={null}
ASAPP.instance.openChat(context, asappIntent= mapOf("Code": "EXAMPLE_INTENT"))
```
# Miscellaneous APIs
Source: https://docs.asapp.com/agent-desk/integrations/android-sdk/miscellaneous-apis
## Conversation Status
To get the current `ASAPPConversationStatus`, implement the `conversationStatusHandler` callback:
```kotlin theme={null}
ASAPP.instance.conversationStatusHandler = { conversationStatus ->
// Handle conversationStatus.isLiveChat and conversationStatus.unreadMessages
}
```
* If `isLiveChat` is `true`, the customer is currently connected to a live support agent or in a queue.
* The `unreadMessages` integer indicates the number of new messages received since last entering Chat.
### Trigger the Conversation Status Handler
You can trigger this handler in two ways:
1. Manually trigger it with:
```kotlin theme={null}
ASAPP.instance.fetchConversationStatus()
```
The Chat SDK fetches the status asynchronously and calls back to `conversationStatusHandler` once it becomes available.
2. The system may trigger the handler when you receive a push notification if the application is in the foreground. If your application handles Firebase push notifications, use:
```kotlin theme={null}
class MyFirebaseMessagingService : FirebaseMessagingService() {
override fun onMessageReceived(message: RemoteMessage) {
super.onMessageReceived(message)
val wasFromAsapp = ASAPP.instance.onFirebaseMessageReceived(message)
// Additional handling...
}
}
```
The Chat SDK only looks for conversation status data in the payload and doesn't cache or persist analytics. If ASAPP sent the push notification, the SDK returns true and triggers the `conversationStatusHandler` callback.
## Debug Logs
By default, the SDK only prints error logs to the console output. To allow the SDK to log warnings and debug information, use `setDebugLoggingEnabled`.
```kotlin theme={null}
ASAPP.instance.setDebugLoggingEnabled(BuildConfig.DEBUG)
```
Disable debug logs for production use.
## Clear the Persisted Session
To clear the ASAPP session persisted on disk:
```kotlin theme={null}
ASAPP.instance.clearSession()
```
Only use this when an identified user signs out. Don't use for anonymous users, as it will cause chat history loss.
## Setting an Intent
### Open Chat with an Initial Intent
```kotlin theme={null}
ASAPP.instance.openChat(context, asappIntent = mapOf("Code" to "EXAMPLE_INTENT"))
```
To set the intent while chat is open, use `ASAPP.instance.setASAPPIntent()`. Only call this if chat is already open. Use `ASAPP.instance.doesASAPPActivityExist` to verify if the user is in chat.
## Handling Chat Events
Implement the `ASAPPChatEventHandler` interface to react to specific chat events:
```kotlin theme={null}
ASAPP.instance.chatEventHandler = object : ASAPPChatEventHandler {
override fun handle(name: String, data: Map?) {
// Handle chat event
}
}
```
These events relate to user flows inside chat, not user behavior like button clicks.
### Implement Chat end, New Issue, and Agent Assigned
To track the `end of a chat`, or add custom codes on `new issue` and `agent assigned`, implement the following custom events
In this example, the system shows event messages as Toasts. But you can add any custom code here.
```kotlin theme={null}
chatEventHandler = object : ASAPPChatEventHandler {
override fun handle(name: String, data: Map?) {
if (name == CustomEvent.CHAT_CLOSED.name) {
Toast.makeText(applicationContext,
"Chat is closed",
Toast.LENGTH_LONG).show()
} else if (name == CustomEvent.NEW_ISSUE.name) {
Toast.makeText(applicationContext,
"New Issue event received",
Toast.LENGTH_LONG).show()
} else if (name == CustomEvent.AGENT_ASSIGNED.name) {
Toast.makeText(applicationContext,
"Agent is assigned",
Toast.LENGTH_LONG).show()
}
}
}
```
### Event Object
Each event in ASAPPChatEventHandler's handle, has a `name` with the name of the event and an `data` map which contains the following custom properties:
`IssueId` (String)
The ASAPP identifier for an individual issue. This ID may change as a user completes and starts new queries to the ASAPP system.
`CustomerId` (String)
The ASAPP identifier for a customer. This ID is consistent for authenticated users but may be different for anonymous ones. Anonymous users will have a consistent ID for the duration of their session.
`EventTime` (Long)
The time the event occurred, in milliseconds since the epoch.
`EventId` (String)
The ASAPP identifier for the event.
`ExternalSenderId` (String)
The external identifier you provide to ASAPP that represents an agent identifier. This property will be undefined if the user is not connected with an agent.
# Notifications
Source: https://docs.asapp.com/agent-desk/integrations/android-sdk/notifications
ASAPP provides the following notifications:
* [Push Notifications](#push-notifications "Push Notifications")
* [Persistent Notifications](#persistent-notifications "Persistent Notifications")
## Push Notifications
ASAPP's systems may trigger push notifications at certain times, such as when an agent sends a message to an end customer who does not currently have the chat interface open. In such scenarios, ASAPP calls your company's API with data that identifies the recipient's device, which triggers push notifications. ASAPP's servers do not communicate with Firebase directly.
ASAPP provides methods in the SDK to register and deregister the customer's device for push notifications.
For a deeper dive on how ASAPP and your company's API handle push notifications, please see our documentation on [Push Notifications and the Mobile SDKs](../push-notifications-and-the-mobile-sdks "Push Notifications and the Mobile SDKs").
In addition to this section, see Android's documentation about [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging) and specifically how to setup [Android Cloud Messaging](https://firebase.google.com/docs/cloud-messaging/android/client).
### Enable Push Notifications
1. Identify which token you will use to send push notifications to the current user. This token is usually either the Firebase instance ID or an identifier that your company's API generates for this purpose.
2. Then, register the push notification token using:
```kotlin theme={null}
ASAPP.instance.updatePushNotificationsToken(newToken: String)
```
In case you issue a new token to the current user, you also need to update it in the SDK.
### Disable Push Notifications
In case the user logs out of the application or other related scenarios, you can disable push notifications for the current user by calling:
`ASAPP.instance.disablePushNotifications().`
Call this function before you change `ASAPP.instance.user` (or clear the session) to prevent the customer from receiving unintended push notifications.
### Handle Push Notifications
You can verify if ASAPP triggered a push notification and passed a data payload into the SDK.
Your application usually won't receive push notifications from ASAPP if the identified user for this device is connected to chat.
For a deeper dive on how Android handles push notifications, please see the Firebase docs on [Receiving Messages in Android](https://firebase.google.com/docs/cloud-messaging/android/receive).
#### Background Push Notifications
If your app receives a push notification while in the background or closed, the system displays the OS notification. Once the user taps the notification, the app starts with `Intent` data from that push notification.
To help differentiate notifications from ASAPP and others your app might receive, ASAPP recommends that the push notification has a `click_action` with the value `asapp.intent.action.OPEN_CHAT`. For more information on how to set a click action, please see the [Firebase documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref#notification-payload-support). With a click action set to the push notification, you will need to add a new intent filter to match it:
```xml theme={null}
```
Once you create the activity, check if it's an ASAPP notification, and then open chat with the data:
```kotlin theme={null}
if (ASAPP.instance.shouldOpenChat(intent)) {
ASAPP.instance.openChat(context = this, androidIntentExtras = intent.extras)
}
```
The helper function [`shouldOpenChat`](https://docs-sdk.asapp.com/api/chatsdk/android/latest/chatsdk/com.asapp.chatsdk/-a-s-a-p-p/should-open-chat.html) simply checks if the intent action matches the recommended one, but its use is optional.
#### Foreground Push Notifications
When you receive Firebase push notifications while your app is in the foreground, it calls `FirebaseMessagingService.onMessageReceived`. Check if that notification is from ASAPP:
```kotlin theme={null}
class MyFirebaseMessagingService : FirebaseMessagingService() {
override fun onMessageReceived(message: RemoteMessage) {
super.onMessageReceived(message)
val wasFromAsapp = ASAPP.instance.onFirebaseMessageReceived(message)
// ...
}
}
```
For a good user experience, ASAPP recommends providing UI feedback to indicate there are new messages instead of opening chat right away. For example, update the unread message counter for your app's chat badge. You can retrieve that information from: `ASAPP.instance.conversationStatusHandler`.
## Persistent Notifications
The ASAPP Android SDK automatically surfaces a persistent notification when a user joins a queue or connects to a live agent (starting on v8.4.0). Tapping the notification triggers an intent that takes the user directly into ASAPP Chat. Once the live chat ends or the user leaves the queue, the SDK dismisses the notification.
Persistent notifications are:
* ongoing, not dismissible [notifications](https://developer.android.com/reference/android/app/Notification).
* low priority and do not vibrate or make sounds.
* managed directly by the SDK and do not require integration changes.
ASAPP enables this feature by default. To disable it, please reach out to your ASAPP Implementation Manager.
Persistent notifications are not push notifications, which are created and handled by your application.
### Customize Persistent Notifications
#### Notification Title and Icon
To customize the title of persistent notifications, override the following string resource:
```json theme={null}
Chat for Customer Support
```
And to customize the icon, create a new drawable resource with the following identifier (file name):
```json theme={null}
drawable/asapp_ic_contact_support.xml
```
ASAPP recommends that you do not change the body of persistent notifications.
#### Notification Channel
By default, ASAPP sets the notification to [Notification Channel](https://developer.android.com/reference/android/app/NotificationChannel) `asapp_chat`, but it is possible to customize the channel being used.
To customize the channel used by persistent notifications, override the following string resources:
```json theme={null}
asapp_chatChat for Customer Support
```
# User Authentication
Source: https://docs.asapp.com/agent-desk/integrations/android-sdk/user-authentication
As in the Quick Start section, you can connect to chat as an anonymous user by not setting a user, or initializing an `ASAPPUser` with a null customer identifier. However, many chat use cases might require ASAPP to know the identity of the user.
To connect as an identified user, please specify a customer identifier string and a request context provider function. This provider will be called from a background thread, when the SDK makes requests that require customer authentication with your company's servers. The request context provider is a function that returns a map with keys and values agreed upon with ASAPP. Please ask your Implementation Manager if you have questions.
## Example:
```kotlin theme={null}
val requestContextProvider = object : ASAPPRequestContextProvider {
override fun getASAPPRequestContext(user: ASAPPUser,
refreshContext:Boolean): Map? {
return mapOf(
"Auth" to mapOf(
"Token" to "example-token"
)
)
}
}
ASAPP.instance.user = ASAPPUser("testuser@example.com", requestContextProvider)
```
## Handle Login Buttons
If you connect to chat anonymously, you may be asked to log in when necessary by being shown a message button:
If you then tap the **Sign In** button, the SDK will use the `ASAPPUserLoginHandler` to call to the application. Due to the asynchronous nature of this flow, your application should use the activity lifecycle to provide a result to the SDK.
How to Implement the Sign In Flow
1. Implement the `ASAPPUserLoginHandler` and start your application's `LoginActivity`, including the given request code.
```kotlin theme={null}
ASAPP.instance.userLoginHandler = object: ASAPPUserLoginHandler {
override fun loginASAPPUser(requestCode: Int, activity: Activity) {
val loginIntent = new Intent(activity, LoginActivity::class.java)
activity.startActivityForResult(loginIntent, requestCode)
}
}
```
2. If a user successfully signs into your application, update the user instance and then finish your `LoginActivity` with `Activity.RESULT_OK`.
```kotlin theme={null}
ASAPP.instance.user = ASAPPUser(userIdentifier, contextProvider)
setResult(Activity.RESULT_OK)
finish()
```
3. In case a user cancels the operation, finish your `LoginActivity` with `Activity.RESULT_CANCELED`.
```kotlin theme={null}
setResult(Activity.RESULT_CANCELED)
finish()
```
After your `LoginActivity` finishes, the SDK will capture the result and resume the chat conversation.
## Token Expiration and Refreshing the Context
If the provided token has expired, the SDK will call the [ASAPPRequestContextProvider](https://docs-sdk.asapp.com/api/chatsdk/android/latest/chatsdk/com.asapp.chatsdk/-a-s-a-p-p-request-context-provider) with an `refreshContext` parameter set to `true` indicating that the context must be refreshed. In that case, please make sure to return a map with fresh credentials that can be used to authenticate the user. In case an API call is required to refresh the credentials, make sure to block the calling thread until the updated context can be returned.
# Apple Messages for Business
Source: https://docs.asapp.com/agent-desk/integrations/apple-messages-for-business
Apple Messages for Business is a service that enables your organization to communicate directly with your customers through your Customer Service Platform (CSP), which in this case will be ASAPP, using the Apple Messages for Business app.
All third party specifications are subject to change by Apple. As such, this section may become out-of-date. ASAPP will always attempt to use the most up-to-date third-party documentation. If you come across any errors or out-of-date content, please contact your ASAPP representative.
## Quick Start Guide
1. Register for an Apple Messages for Business account
2. Specify Entry Points
3. Complete User Experience Review
4. Determine Launch & Throttling Strategy
### Register for an Apple Messages for Business Account
Before integrating with ASAPP's Apple Messages for Business adapter, you must register an account with Apple. See [Apple Messages for Business Getting Started](https://register.apple.com/resources/messages/messaging-documentation/register-your-acct#getting-started) documentation for more details.
### Specify Entry Points
Entry points are where your customers start conversations with your business. You can select from Apple and ASAPP entry points.
#### Apple Entry Points
Apple supports multiple entry points for customers to engage using the Messages app. See [Apple Messages for Business Entry Points](https://register.apple.com/resources/messages/messaging-documentation/customer-journey#entry-points) documentation for more information.
#### ASAPP Entry Point
ASAPP supports the Chat Instead entry point. See the [Chat Instead](/agent-desk/integrations/chat-instead "Chat Instead") documentation for more information.
### Complete User Experience Review
Apple requires a Brand Experience QA review before you can launch the channel. Please work with your Engagement Manager to prepare and schedule for the QA review. See the [Apple User Experience Review](https://register.apple.com/resources/messages/messaging-documentation/pass-apple-qa) documentation for more information.
### Determine Launch & Throttling Strategy
Depending on the entry points configured, your Engagement Manager will share launch best practices and throttling strategies.
## Customer Authentication
Apple Messages for Business supports Customer Authentication, which allows for a better and personalized customer experience. You can implement Authentication using OAuth.
### OAuth
* Requires OAuth 2.0 implemented by customer
* No support for biometric (fingerprint/Face Id) authentication on device
* Does not require native iOS app
User Authentication in Apple Messages for Business can utilize a standards-based approach using an OAuth 2.0 flow with additional key validation and OAuth token encryption steps.
This approach requires customers to implement and host a login page that Apple Messages for Business will invoke to authenticate the user. Users will have to sign-in with their credentials every time their OAuth token expires.
Additional steps are required to support authorization for users with devices running versions older than iOS 15. Consult your ASAPP account team for more information.
#### Latest Authentication Flow
#### Old Authentication Flow
ASAPP requires the following customer functionalities to support the older authentication flow:
* An OAuth 2.0 login flow, including a login page that supports form autofill. This page must be Apple-compliant. See the [Authentication Message](https://register.apple.com/resources/messages/msp-rest-api/type-interactive#authentication-message) documentation for more details.
* Provide an API endpoint for ASAPP to obtain an external user identifier. This should be the same identifier that is supplied via the ASAPP web and mobile SDKs as the CustomerId.
* Provide an endpoint through which to obtain an access token by supplying an authcode. This endpoint must support URL encoded parameters.
* Provide an endpoint that can accepted POST requests in the following format:
```json theme={null}
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code&code=xxxx
&client_id=yyyy&client_secret=zzzz
where:
xxxx=authorization_code value
yyyy=client_id value
zzzz=client_secret value
```
The authorization request from the device to the customer's login page will always contain response\_type, client\_id, redirect\_uri, scope and state and will be application/x-www-form-urlencoded
Also note that the older authentication flow is backwards-compatible for iOS versions 16+.
# Chat Instead Overview
Source: https://docs.asapp.com/agent-desk/integrations/chat-instead
Chat Instead is a feature that prompts customers to chat instead of calling. When customer volume shifts from calls to chat, this reduces costs and improves the customer experience.
You can use any ASAPP SDK to display a menu when a customer taps on a phone number to give them the option to Chat Instead or to call.
To enable this feature:
1. Identify Call buttons or phone numbers on your website that you want to convert into entry points for Chat Instead.
2. Use the Chat Instead API, which is part of the ASAPP SDK.
3. Contact your Implementation Manager to configure Chat Instead.
See the following sections for more information:
* [Android](/agent-desk/integrations/chat-instead/android "Android")
* [iOS](/agent-desk/integrations/chat-instead/ios "iOS")
* [Web](/agent-desk/integrations/chat-instead/web "Web")
# Android
Source: https://docs.asapp.com/agent-desk/integrations/chat-instead/android
## Requirements
Chat Instead requires ASAPP Android Chat SDK 8.0.0 or later, and a valid phone number. Before you proceed, make sure you configure it [correctly](/agent-desk/integrations/android-sdk).
## Phone Formats
Chat Instead accepts a wide variety of formats. See [tools.ietf.org/html/rfc3966](https://tools.ietf.org/html/rfc3966) for the precise definition. For example, Chat Instead accepts: "+1 (555) 555-5555" and "555-555-5555".
## Getting Started
There are two ways to add Chat Instead. The easiest way is to add the `ASAPPChatInsteadButton` to the layout and call the `ASAPPChatInsteadButton.init`. Alternatively, you can manage the lifecycle yourself.
### 1. Add an ASAPPChatInsteadButton
You can add this button to any layout, like any other [AppCompatButton](https://developer.android.com/reference/androidx/appcompat/widget/AppCompatButton).
```json theme={null}
```
After that, be sure to call the `ASAPPChatInsteadButton.init` method. Only the phone number is mandatory. Optionally, you can overwrite the `ASAPPChatInsteadButton.onChannel` and the `ASAPPChatInsteadButton.onError` properties of the button.
### 2. Manual Setup of ASAPPChatInstead
1. Initialize Chat Instead
Somewhere after the `ASAPP.init` call:
```json theme={null}
val chatInstead = ASAPPChatInstead.create(phoneNumber)
```
to initialize Chat Instead. Depending on cache, this will trigger a network call so channels are "immediately" available to the user once the fragment is displayed.
Along with an optional header and a chat icon, you can pass callbacks to be notified when a channel is tapped or an error on a channel happens.
ASAPP makes both callbacks after Chat Instead tries to act on the tap.
2. Display Channels
With the instance returned by `ASAPPChatInstead.init`, call `ASAPPChatInstead.show` whenever you want to display the [BottomSheetDialogFragment](https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetDialogFragment?hl=en). Depending on cache, this might show a loading state.
3. Clear Chat Instead (optional)
You can interrupt the Chat Instead initial network call, if you call `ASAPPChatInstead.clear`. ASAPP advises you to add the call `onDestroy` for Activities and `onDetachedFromWindow` for Fragments.
If you call `ASAPPChatInstead.clear` after you create the [BottomSheetDialogFragment](https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetDialogFragment?hl=en) view, it has no effect.
## Error Handling and Debugging
In the case of problems, look for logs with the "ASAPPChatInstead" tag. Be sure to call `ASAPP.setDebugLoggingEnabled(true)` to enable the logs.
Alternatively, you can set callbacks with `ASAPPChatInstead.init`.
### Troubleshoot Chat Instead Errors
#### Crash Caused by UnsupportedOperationException when Displaying the Fragment
This occurs whenever someone does not define `asapp_primary` in the style that the calling Activity uses. Please refer to **Customization > Colors**.
#### "Unknown Channel" in the Log or the onError Callback
Talk to your Implementation Manager at ASAPP. ASAPP's Backend sent a channel we don't know how to handle. You might need to upgrade the Android SDK version.
#### "Unknown Error" in the Log
Talk to your Implementation Manager at ASAPP. This might be a bug. Please attach logs and reproduction steps.
#### "Activity Context Not Found" in the Log
It means you are not sending the right context at `ASAPPChatInstead.show`.
## Tablet and Landscape Support
Chat Instead supports these configurations seamlessly.
## Customization
### Header
By default, Chat Instead uses the text in `R.string.asapp_chat_instead_default_header`. You can send a different string when initializing Chat Instead, but the ASAPP Backend overwrites it if the call succeeds.
### Chat Icon
You can customize the SDK Chat channel icon. By default, the system tints it with `asapp_primary` and `asapp_on_primary`.
If you customize the icon, make sure to test how it looks in Night Mode (a.k.a. Dark Mode).
### Colors
Chat Instead uses the ASAPP text styles and colors. For more information on how to customize, go to [Customization](../android-sdk/customization "Customization").
## Remote settings
Chat Instead receives configuration information from ASAPP's Backend (BE), in addition to the channels to display. The configuration enables/disables the feature and selects the device type (mobile, tablet, none). Contact your Implementation Manager at ASAPP if you have any questions.
It's important to know how the BE affects customization. If you provide a header, the BE overwrites it. On the other hand, the BE cannot overwrite the phone number.
## Cache
Chat Instead will temporarily cache the displayed channels to provide a better user experience. The cache is warmed at instantiation. The information persists through phone restarts. As usual, it does not survive an uninstall or a "clear cache" in App info.
# iOS
Source: https://docs.asapp.com/agent-desk/integrations/chat-instead/ios
## Pre-requisites
* ASAPP iOS SDK 9.4.0 or later, correctly configured and initialized [see more here](/agent-desk/integrations/ios-sdk/ios-quick-start).
## Getting Started
Once you've successfully configured and initialized the ASAPP SDK, you can start using Chat Instead for iOS.
1. Create a New Instance.
```json theme={null}
let chatInsteadViewController = ASAPPChatInsteadViewController(phoneNumber: phoneNumber, delegate: delegate, title: title, chatIcon: image)
```
| | |
| :--------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| phoneNumber (required) | The phone number to call when the phone channel is selected. Must be a valid phone number. For more information, see Apple's documentation on [phone links](https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/PhoneLinks/PhoneLinks). |
| delegate (required) | An object that implements `ASAPPChannelDelegate`. |
| title (optional) | A title (also called the "Chat Instead header title") which is displayed at the top of the Chat Instead UI. (See [Customization](#customization "Customization")) |
| image (optional) | A UI Image that will override the default image for the chat channel. (See [Customization](#customization "Customization")) |
2. Implement two functions that the `ASAPPChannelDelegate` requires:
```json theme={null}
func channel(_ channel: ASAPPChannel, didFailToOpenWithErrorDescription errorDescription: String?)
```
ASAPP calls this if an error occurs while trying to open a channel.
```json theme={null}
func didSelectASAPPChatChannel()
```
This opens the ASAPP chat.
You should use one of these methods:
```json theme={null}
ASAPP.createChatViewControllerForPresentingFromChatInstead()
```
or
```json theme={null}
ASAPP.createChatViewControllerForPushingFromChatInstead()
```
to present or push the view controller instance that ASAPP returned.
This means that you must present/push the ASAPP chat view controller inside `didSelectASAPPChatChannel()`.
ASAPP highly recommends initializing `ASAPPChatInsteadViewController` as early as possible for the best user experience.
Whenever a channel is selected, ASAPP handles everything by default (except for the chat channel), but you can also handle a channel by yourself by implementing `func shouldOpenChannel(_ channel: ASAPPChannel) -> Bool` and returning false.
3. Show the `chatInsteadViewController` instance by using:
```json theme={null}
present(chatInsteadViewController, animated: true)
```
Only presentation works. Pushing the `chatInsteadViewController` instance does not work and causes unexpected behavior.
## Support for iPad
For the best user experience, you should configure popover mode, which is used on iPad.
Use the `.popover` presentation style and set both the [sourceView](https://developer.apple.com/documentation/uikit/uipopoverpresentationcontroller/1622313-sourceview) and [sourceRect](https://developer.apple.com/documentation/uikit/uipopoverpresentationcontroller/1622324-sourcerect) properties following Apple's conventions:
```json theme={null}
chatInsteadViewController.modalPresentationStyle = .popover
chatInsteadViewController.popoverPresentationController?.sourceView = aView
chatInsteadViewController.popoverPresentationController?.sourceRect = aRect
```
This will only have an effect when your app is run on iPad.
If you set `modalPresentationStyle` to `.popover` and forget to set `sourceView` and `sourceRect`, the application will crash in runtime. So please be sure to set both if you're using the popover mode.
## Customization
You can customize the Chat Instead header title and the chat icon when creating the `ASAPPChatInsteadViewController` instance. (See [Getting Started](#getting-started "iOS").
`ASAPPChatInsteadViewController` uses [ASAPPColors](https://docs-sdk.asapp.com/api/chatsdk/ios/latest/Classes/ASAPPColors.html) for styling, so it will automatically use the colors set there (e.g. `primary`, `background`, `onBackground`, etc.), which are the same colors used for customizing the ASAPP chat interface. There is no way to independently change the styling of the Chat Instead UI.
ASAPP supports [Dark Mode](../ios-sdk/customization#dark-mode-15935 "Dark Mode") by default as long as you enable it.
## Remote settings
When you create an instance of `ASAPPChatInsteadViewController`, it automatically fetches remote settings to indicate which channels to display. You can configure these settings.
These remote settings override local ones (i.e. the ones you pass in when creating the `ASAPPChatInsteadViewController` instance).
If an error occurs while fetching the settings and no local values were set, the system uses the defaults.
## Cache
When fetching succeeds, the SDK caches the remote settings for a short period of time. This cache references in lieu of repeated fetches. The cache remains valid across multiple app sessions.
# Web
Source: https://docs.asapp.com/agent-desk/integrations/chat-instead/web
A feature that prompts customers to use Chat instead of calling. When customers shift volume from phone to chat, this reduces costs and improves the customer experience.
When customers tap a phone number, phone button, or any other entry point that the customer company chooses, ASAPP triggers an intercept that gives the customer the option to chat or call.
In order to enable this feature, please:
1. Identify Entry Points.
Contact your Implementation Manager to determine the best entry point to Chat Instead on your website. On Mobile, the best entry point is a "Call" button or a clickable phone number. On Desktop, the best entry point is a "Call" button.
ASAPP recommends that you modify your website to display a "Call Us" button (or other similar language) rather than displaying the phone number, and the "Call Us" button should invoke Chat Instead.
ASAPP recommends that you also make all entry points telephone links (href="tel" number).
The customer company must specify the formatting to display for the phone number that they pass to the [showChatInstead](../web-sdk/web-javascript-api#-showchatinstead- "'showChatInstead'") API: (800) 123-4567
**Example Use Case:**
```json theme={null}
(800) 123-4567
```
2. Integrate with the [showChatInstead](../web-sdk/web-javascript-api#-showchatinstead- "'showChatInstead'") API.
3. Chat Instead receives configuration information from ASAPP's Backend (BE), in addition to the channels to display and the order to display them in. Contact your Implementation Manager to turn on Chat Instead and configure these options. If you would like to use Apple Business Chat or other messaging application as an option within Chat Instead, please inform your Implementation Manager.
This feature is currently available in the mobile Web SDK and desktop Web SDK.
| | |
| :--------------------- | :--------------------- |
| | |
# Customer Authentication
Source: https://docs.asapp.com/agent-desk/integrations/customer-authentication
Customer Authentication enables consistent and personalized conversations across channels and over time. The authentication requirements consist of two main elements:
1. A customer identifier
2. An access token
The source, format, and use of these items depends on the customer's infrastructure and services. However, where applicable and feasible, ASAPP instills a few direct requirements for integration of these components.
This section outlines the requirements and considerations in the sections below.
Integrations leveraging customer authentication enable two main features of ASAPP:
1. Combine the conversation history of a customer into a single view to enable the true asynchronous behavior of ASAPP. This allows a customer to come back over time as well as change communication channels but maintain a consistent state and experience.
2. Validate a customer and make API calls for a customer's data to display to a representative or directly to the customer.
The following sequence diagram depicts an example of a customer authentication integration utilizing OAuth customer credentials and a JSON Web Token (JWT) for API calls.
## Identification
### What is a Customer Identifier?
A customer identifier is the first and most important piece of the Customer Authentication strategy. The identifier is the key element to determine:
* when to transition from unauthenticated to authenticated
* when to show previous conversation history within chat
When a customer returns with the same identifier, the customer sees all previous history within web and mobile chat. These identifiers are typically string values of hashed or encrypted account numbers or other internal values. However, it is important to not send identifiable or reusable information as the customer identifier, such as their actual unprotected account numbers or PII.
### Customer Identifier Format
The customer may determine the format of the customer identifier. The ASAPP requirements for the customer identifier are:
* Consistent - the same customer must authenticate using the same customer identifier every time.
* Unique - the customer identifier must represent a unique customer; No two customers can have the same identifier.
* Opaque - ASAPP does not store PII data. The customer must obfuscate the customer identifier so it does not contain PII or any other sensitive data. An example of obfuscation strategy is to generate a hash or an encrypted value of a unique user identifier (e.g. user ID, account number, or email address).
* Traceable - customer-traceable but not ASAPP-traceable.
* The customer must be able to trace the customer identifier back to a user. However, it cannot be used by ASAPP, or any other party, to trace back to a specific user.
* The reporting data generated by ASAPP includes the customer identifier. This reporting data is typically used to generate further analytics by the customer. You can use the customer identifier to relate ASAPP's reporting data back to the actual user identifier and record on the customer side.
### Passing the Customer Identifier to ASAPP
Once a customer authenticates a user on their website or app, the customer must retrieve and pass the customer identifier to ASAPP ( typically via the SDK parameters) as part of the conversation authentication flow.
You can find more details for your specific integration in the following sections:
* [Web SDK - Web Authentication](/agent-desk/integrations/web-sdk/web-authentication "Web Authentication")
* [Android SDK - Chat User Authentication in the Android Integration Walkthrough](/agent-desk/integrations/android-sdk/user-authentication)
* [iOS SDK - Basic Usage in the iOS SDK Quick Start](/agent-desk/integrations/ios-sdk/ios-quick-start)iOS SDK
## Tokens
While they are not a hard requirement for Customer Authentication, tokens play an important part in the overall Customer Authentication strategy. Tokens provide a way of securely wrapping all communication between Customers, Customer Companies and ASAPP. You can achieve this when you ensure that every request to a server is accompanied by a signed token, which ASAPP can verify for authenticity.
Some of the benefits of using tokens over other methods, such as cookies, is that tokens are completely stateless and are typically short-lived. The following sections outline some examples of token input, as well as requirements for their use and validation.
### Identity Tokens
Identity tokens are self contained, signed, short-lived tokens containing User Attributes like Name, User Identifiers, Contact Information, Claims, and Roles. The simplest and most common example of such a token is a JSON Web Token, JWT. JWTs contain a Header, Payload and Signature. The Header contains metadata about the token, the Payload contains the user info and claims, and the Signature is the algorithmically signed portion of the token based on the payload. You can find more information about JWTs at [https://jwt.io/](https://jwt.io/).
**Example JWT:**
```json theme={null}
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
```
### Bearer Tokens
A Bearer Token is a lightweight security token which provides the bearer, or user, access to protected resources. When a user authenticates, the system issues a Bearer Token type that contains an access token and a refresh token, along with expiration details. Bearer tokens are short-lived, dynamic access tokens that you can update throughout a session using a refresh token.
**Example Bearer Token:**
```json theme={null}
{
"token_type":"Bearer",
"access_token":"eyJhbGci....",
"expires_in":3600,
"expires_on":1479937454,
"refresh_token":"0/LTo...."
}
```
### Token Duration
Since every token has an expiration time, you need a way for ASAPP to know when a token is valid and when it expires. A customer can do this by:
* allowing decoding of signed tokens.
* providing an API to validate the token.
#### Token Refresh
You need to refresh expired tokens on either the client side, via the ASAPP SDK, or through an API call.
You can find SDK token refresh implementation examples at:
* [Web SDK - Web Context Provider](/agent-desk/integrations/web-sdk/web-contextprovider#authentication "Web ContextProvider")
* [Web SDK - Set Customer](/agent-desk/integrations/web-sdk/web-javascript-api#setcustomer "'setCustomer'")
* [Android SDK - Context Provider](/agent-desk/integrations/android-sdk/user-authentication)
* [iOS SDK - Type Aliases](https://docs-sdk.asapp.com/api/chatsdk/ios/latest/Typealiases.html)
#### Token Validation
You need to validate tokens before you can rely on them for API access or user information. Two examples of token validation are:
* **Compare multiple pieces of information** - ASAPP compares a JWT payload against the SDK input of the same attributes, or against response data from a UserProfile API call.
* **Signature Validation** - ASAPP can also validate signatures and decode data if needed. This would require sharing of a trusted public certificate with ASAPP.
## Omni-Channel Strategy
One of the key capabilities of the ASAPP backend is that it supports customer interaction via multiple channels - such as chat on web portals or within mobile apps. This enables a customer to migrate from one channel to another, if they choose, within the same support dialog. In order for this to function, it is important that the process of Customer Authentication be common to all channels. The ASAPP backend should obtain the same access token to access the Customer's API endpoints regardless of the channel that the customer selects. If a customer switches from one channel to another, the access token should remain the same.
## Testing
You need a comprehensive testing strategy to ensure success. This includes the ability to exercise edge cases with various permutations of test account data, as well as utilize the customer login with direct test account credentials. Operationally, the customer handles customer login credentialing; however, ASAPP requires the ability to simulate the login process in order to execute end to end tests. This process is crucial in performing test scenarios that require customer authentication. Corollary, it is equally important to ensure complete test scenario coverage with different types of test-based customer accounts.
# iOS SDK Overview
Source: https://docs.asapp.com/agent-desk/integrations/ios-sdk
Welcome to the ASAPP iOS SDK Overview! This document guides you through the process of integrating ASAPP functionality into your iOS application. It includes the following sections:
* [Quick Start](/agent-desk/integrations/ios-sdk/ios-quick-start "iOS Quick Start")
* [Customization](/agent-desk/integrations/ios-sdk/customization "Customization")
* [User Authentication](/agent-desk/integrations/ios-sdk/user-authentication "User Authentication")
* [Miscellaneous APIs](/agent-desk/integrations/ios-sdk/miscellaneous-apis "Miscellaneous APIs")
* [Deep Links and Web Links](/agent-desk/integrations/ios-sdk/deep-links-and-web-links "Deep Links and Web Links")
* [Push Notifications](/agent-desk/integrations/ios-sdk/push-notifications "Push Notifications")
In addition, you can view the following documentation:
* [iOS SDK Release Notes](/agent-desk/integrations/ios-sdk/ios-sdk-release-notes "iOS SDK Release Notes")
## Requirements
ASAPP supports iOS 12.0 and up. As a rule, ASAPP supports two major versions behind the latest. Once iOS 15 is released, ASAPP will drop support for iOS 12 and only support iOS 13.0 and up.
The SDK is written in Swift 5 and compiled with support for binary stability, meaning it is compatible with any Swift compiler version greater than or equal to 5.
# Customization
Source: https://docs.asapp.com/agent-desk/integrations/ios-sdk/customization
## Styling
### Themes
There is one main color that you can set to ensure the ASAPP chat view controller fits with your app's theme: `ASAPP.styles.colors.primary`.
ASAPP recommends starting out only setting `.primary` to be your brand's primary color, and adjusting other colors when necessary for accessibility.
The system uses `.primary` as the message bubble background and in most buttons and other controls.
There are two other colors you may consider customizing for accessibility or to achieve an exact match with your app's theme: `ASAPP.styles.colors.onBackground` and `.onPrimary`. Most other elements that might appear in front of the background use `.onBackground`. Text and other elements that appear in front of the primary color use `.onPrimary`.
### Fonts
The ASAPP SDK uses the iOS system font family, SF Pro, by default. To use another font family, pass an `ASAPPFontFamily` to `ASAPP.styles.textStyles.updateStyles(for:)`. There are two `ASAPPFontFamily` initializers: one that takes font file names and another that takes `UIFont` references.
```json theme={null}
let avenirNext = ASAPPFontFamily(
lightFontName: “AvenirNext-Regular”,
regularFontName: “AvenirNext-Medium”,
mediumFontName: “AvenirNext-DemiBold”,
boldFontName: “AvenirNext-Bold”)!
ASAPP.styles.textStyles.updateStyles(for: avenirNext)
```
## Overrides
The ASAPP SDK API allows you to override many aspects of the design of the chat interface, including [colors](#colors "Colors"), [button styles](#buttons "Buttons"), [navigation bar styles](#navigation-bar-styles "Navigation Bar Styles"), and various [text styles](#text-styles "Text Styles").
### Colors
Besides the colors used for themes, you can override specific colors in a number of categories:
* Navigation bar
* General chat content
* Buttons
* Messages
* Quick replies
* Input field.
All property names mentioned below are under `ASAPP.styles.colors`.
Navigation bar colors are .`navBarBackground`, `.navBarTitle`, `.navBarButton`, and `.navBarButtonActive`.
General chat content colors are `.background`, `.separatorPrimary`, `.separatorSecondary`, `.controlTint`, `.controlSecondary`, `.controlBackground`, `.success`, `.warning`, and `.failure`.
Buttons use sets of colors defined with an `ASAPPButtonColors` initializer. You can override `.textButtonPrimary`, `.buttonPrimary`, and `.buttonSecondary`.
Message colors are `.messagesListBackground`, `.messageText`, `.messageBackground`, `.messageBorder`, `.replyMessageText`, `.replyMessageBackground`, and `.replyMessageBorder`.
Quick replies and action buttons also use `ASAPPButtonColors`. You can override `.quickReplyButton` and `.actionButton`.
The chat input field uses `ASAPPInputColors`. You can override `.chatInput`.
### Text Styles
ASAPP strongly recommends that you use one font family as described in the [Fonts](#fonts) section. However, if you need to, you may override: `ASAPP.styles.textStyles.navButton`, `.button`, `.actionButton`, `.link`, `.header1`, `.header2`, `.header3`, `.subheader`, `.body`, `.bodyBold`, `.body2`, `.bodyBold2`, `.detail1`, `.detail2`, and `.error`. To update all but the first four with a color, call `ASAPP.styles.textStyles.updateColors(with:)`.
### Navigation Bar Styles
You can override the default `ASAPP.styles.navBarStyles.titlePadding` using `UIEdgeInsets`.
### Buttons
The shape of primary buttons in message attachments, forms, and other dynamic layouts depends on the value of `ASAPP.styles.primaryButtonRoundingStyle`. The default value is `.radius(0)`. You can set it to a custom radius with `.radius(_:)` or fully rounded with `.pill`.
## Images
### Navigation Bar
There are three images used in the chat view controller's navigation bar that are overridable: the icons for the **close ✕**, **back ⟨**, and **more ⋮** buttons. Each is tinted appropriately, so the image need only be a template in black with an alpha channel. ASAPP displays only one of the **close** and **back** buttons at a time; the former is used when the chat view controller is presented modally, and the latter when pushed onto a navigation stack.
```json theme={null}
ASAPP.styles.navBarStyles.buttonImages.close
ASAPP.styles.navBarStyles.buttonImages.back
ASAPP.styles.navBarStyles.buttonImages.more
```
Use the `ASAPPCustomImage(image:size:insets:)` initializer to override each:
```json theme={null}
ASAPP.styles.navBarStyles.buttonImages.more = ASAPPCustomImage(
image: UIImage(named: “Your More Icon Name”)!,
size: CGSize(width: 20, height: 20),
insets: UIEdgeInsets(top: 14, left: 0, bottom: 14, right: 0))
```
### Title View
To use a custom title view, assign `ASAPP.views.chatTitle`. If you set a custom title view, it will override any string you set as `ASAPP.strings.chatTitle`. The title view will be rendered in the center of the navigation bar.
## Quick Reply View Height
To set quick reply view height, assign value to 'maxQuickReplyViewHeight' variable which is part of the class 'ASAPPCustomViewStyles'. We have added a safe height value calculation based on the value provided to 'maxQuickReplyViewHeight' and the quick replies contents data. We should not allow any random higher value to maxQuickReplyViewHeight. The quickReplies height view should not increase to the middle of the iPhone as the chat conversation list view contents visibility will be reduced. Hence we have added a safe height value calculation logic to avoid such UI issues. You can try different values like 180, 240, 300 etc to check the UI. You can set the preferred tint color to 'titleBar.actionBackButton'
```json theme={null}
let customViewStyle = ASAPPCustomViewStyles()
customViewStyle.maxQuickReplyViewHeight = 300
customViewStyle.titleBar.actionBackButton = OptionalButtonTypeConfig(
tintColorNormal: UIColor.orange
)
ASAPP.views.customViewStyle = customViewStyle
```
## Banner Theme
To set customised theme to sucess, warning and failure banners.
```json theme={null}
func setBannerTheme() {
let customViewStyle = ASAPPCustomViewStyles()
let successImageObj = UIImage(named: "PlusIcon")
let warningImageObj = UIImage(named: "PlusIcon")
let successFontInfo = UIFont(name: "BrutalType-Light", size: 14)!
let failureFontInfo = UIFont(name: "BrutalType-Black", size: 14)!
//Success
customViewStyle.connectionBar.success = ConnectionBar(
container: OptionalViewTypeConfig(
backgroundColor: FeedbackType.error.getBackgroundColor()
), primaryText: OptionalTextTypeConfig(
typeface: failureFontInfo,
letterSpacing: 0,
color: .white
), icon: OptionalImageViewTypeConfig(width: 22, height: 22, src: warningImageObj)
)
//Warning
customViewStyle.connectionBar.warn = ConnectionBar(
container: OptionalViewTypeConfig(
backgroundColor: FeedbackType.warning.getBackgroundColor()
), primaryText: OptionalTextTypeConfig(
typeface: UIFont.systemFont(ofSize: 14),
letterSpacing: 0,
color: .black
), icon: OptionalImageViewTypeConfig(width: 22, height: 22, src: warningImageObj
)
)
//Error
customViewStyle.connectionBar.error = ConnectionBar(
container: OptionalViewTypeConfig(
backgroundColor: FeedbackType.error.getBackgroundColor()
), primaryText: OptionalTextTypeConfig(
typeface: failureFontInfo,
letterSpacing: 0,
color: .white
), icon: OptionalImageViewTypeConfig(width: 22, height: 22, src: warningImageObj)
)
customViewStyle.titleBar.actionBackButton = OptionalButtonTypeConfig(
tintColorNormal: UIColor.orange
)
ASAPP.views.customViewStyle = customViewStyle
}
```
## Modal Button Styling
To set the bottom sheet alert button title, body text UI, confirmation and cancel buttons UI
```json theme={null}
let customViewStyle = ASAPPCustomViewStyles()
customViewStyle.titleBar.actionBackButton = OptionalButtonTypeConfig(
tintColorNormal: UIColor.blue
)
customViewStyle.bottomSheetConfirmationDialog.title = OptionalTextTypeConfig(typeface: UIFont.systemFont(ofSize: 16, weight: .bold), color: UIColor.black)
customViewStyle.bottomSheetConfirmationDialog.bodyText = OptionalTextTypeConfig(typeface: UIFont.systemFont(ofSize: 14, weight: .regular), color: UIColor.red)
customViewStyle.bottomSheetConfirmationDialog.confirmButtonBar.button = OptionalButtonTypeConfig(width: ButtonWidthType.matchParent.rawValue, margin: 40)
customViewStyle.bottomSheetConfirmationDialog.cancelButtonBar.button = OptionalButtonTypeConfig(width: ButtonWidthType.matchParent.rawValue, margin: 40)
ASAPP.views.customViewStyle = customViewStyle
```
## Leave Button Text And Progress Bar
To set the leave button, your position text UI and progress bar UI.
```json theme={null}
let customViewStyle = ASAPPCustomViewStyles()
customViewStyle.titleBar.actionBackButton = OptionalButtonTypeConfig(
tintColorNormal: UIColor.orange
)
customViewStyle.ewtBar.progressBar = OptionalProgressBarTypeConfig(isVisible: true, backgroundColor: UIColor.red, progressColor: UIColor.lightGray)
customViewStyle.ewtBar.btnLeave = OptionalButtonTypeConfig(typeface: UIFont.systemFont(ofSize: 18.0, weight: .regular), textColorNormal: UIColor.red)
customViewStyle.ewtBar.txtEwtTitle = OptionalTextTypeConfig(typeface: UIFont.systemFont(ofSize: 16), color: UIColor.darkGray)
customViewStyle.ewtBar.txtEwtValue = OptionalTextTypeConfig(typeface: UIFont.systemFont(ofSize: 22.0), color: UIColor.darkGray)
ASAPP.views.customViewStyle = customViewStyle
```
## New Question Text Style
To set custom UI for New Question text font, text color and highlighted color etc.
```json theme={null}
let customViewStyle = ASAPPCustomViewStyles()
customViewStyle.titleBar.actionBackButton = OptionalButtonTypeConfig(
tintColorNormal: UIColor.orange
)
customViewStyle.restartButtonBar.primaryText = OptionalButtonTypeConfig(typeface: UIFont.systemFont(ofSize: 18), textColorNormal: UIColor.darkGray, textColorHighlighted: UIColor.green)
customViewStyle.restartButtonBar.icon = OptionalImageViewTypeConfig(src: UIImage(named: "PlusIcon"), tintColor: UIColor.orange)
ASAPP.views.customViewStyle = customViewStyle
```
## Send Button Theme
To set custom UI for chat text Send button theme
```json theme={null}
let customViewStyle = ASAPPCustomViewStyles()
customViewStyle.titleBar.actionBackButton = OptionalButtonTypeConfig(
tintColorNormal: UIColor.purple
)
customViewStyle.chatComposerBar.btnSend = OptionalButtonTypeConfig(
tintColorNormal: UIColor.purple
)
ASAPP.views.customViewStyle = customViewStyle
```
## Title Bar Theme
To set custom back button, title bar icon, title bar More button themes.
```json theme={null}
let customViewStyle = ASAPPCustomViewStyles()
customViewStyle.titleBar.actionBackButton = OptionalButtonTypeConfig(
tintColorNormal: UIColor.systemPink
)
customViewStyle.titleBar.actionMoreButton = OptionalButtonTypeConfig(
tintColorNormal: UIColor.systemPink
)
let warningImageObj = UIImage(named: "PlusIcon")
customViewStyle.titleBar.primaryText = OptionalTextTypeConfig(typeface: UIFont.systemFont(ofSize: 18, weight: .bold), color: UIColor.orange)
customViewStyle.titleBar.icon = OptionalImageViewTypeConfig(width: 16, height: 16, src: warningImageObj, tintColor: UIColor.systemPink)
ASAPP.views.customViewStyle = customViewStyle
let strings = ASAPPStrings()
strings.chatTitle = "Chat Test"
ASAPP.strings = strings
```
## Dark Mode
Apple introduced Dark Mode in iOS 13. Please see Apple's [Supporting Dark Mode in Your Interface](https://developer.apple.com/documentation/xcode/supporting_dark_mode_in_your_interface) documentation for an overview.
The ASAPP SDK does not automatically convert any colors for use in Dark Mode; you must define dark variants for each custom color at the app level, which the SDK will use automatically when the interface style changes.
ASAPP recommends that you add a Dark Appearance to colors you define in color sets in an asset catalog. Please see [Apple's documentation](https://developer.apple.com/documentation/xcode/supporting_dark_mode_in_your_interface#2993897) for more details. Once you have defined a color set, you can refer to it by name with the `UIColor(named:)` initializer, which was introduced in iOS 11. After you have defined a dark variant for at least the primary color, be sure to set it and flip the Dark Mode flag:
```json theme={null}
ASAPP.styles.colors.primary = UIColor(named: "Your Primary Color Name")!
ASAPP.styles.isDarkModeAllowed = true
```
ASAPP highly recommends adding a Dark Appearance for any color you set. Please don't forget to define a Dark Appearance for your custom logo if you have set `ASAPP.views.chatTitle`.
If your app does not support Dark Mode, ASAPP recommends that you do not change the value of `ASAPP.styles.isDarkModeAllowed` to ensure a consistent user experience.
## Orientation
The default value of `ASAPP.styles.allowedOrientations` is `.portraitLocked`, meaning the chat view controller will always render in portrait orientation. To allow landscape orientation on an iPad, set it to `.iPadLandscapeAllowed` instead. There is currently no landscape orientation option for iPhone.
## Strings
Please see the class reference for details on each member of `ASAPPStrings`.
# Deep Links and Web Links
Source: https://docs.asapp.com/agent-desk/integrations/ios-sdk/deep-links-and-web-links
## Handle Deep Links in Chat
Certain chat flows may present buttons that are deep links to another part of your app. To react to taps on these buttons, implement the `ASAPPDelegate` protocol, including the `chatViewControlledDidTapDeepLink(name:data:)` method. Please ask your Implementation Manager if you have questions regarding deep link names and data.
## Handle Web Links in Chat
Certain chat flows may present buttons that are web links. To react to taps on these buttons, implement the `ASAPPDelegate` protocol, including the `chatViewControllerShouldHandleWebLink(url:)` method. Return true if the ASAPP SDK should open the link in an `SFSafariViewController`; return `false` if you'd like to handle it instead.
## Implement Deep Links into Chat
### Getting Started
Please see Apple's documentation on [Allowing Apps and Websites to Link to Your Content](https://developer.apple.com/documentation/xcode/allowing_apps_and_websites_to_link_to_your_content).
### Connect the Pieces
Once you have set up a custom URL scheme for your app, you can detect links pointing to ASAPP chat within `application(_:open:options:)`. Call one of the four provided methods to create an ASAPP chat view controller:
```json theme={null}
ASAPP.createChatViewControllerForPushing(fromNotificationWith:)
ASAPP.createChatViewControllerForPresenting(fromNotificationWith:)
ASAPP.createChatViewControllerForPushing(withIntent:)
ASAPP.createChatViewControllerForPresenting(withIntent:)
```
# iOS Quick Start
Source: https://docs.asapp.com/agent-desk/integrations/ios-sdk/ios-quick-start
If you want to start fast, follow these steps:
1. [Gather Required Information](#1-gather-required-information "1. Gather Required Information")
2. [Download the SDK](#2-download-the-sdk "2. Download the SDK")
3. [Install the SDK](#3-install-the-sdk "3. Install the SDK")
4. [Configure the SDK](#4-configure-the-sdk "4. Configure the SDK")
5. [Open Chat](#5-open-chat "5. Open Chat")
## 1. Gather Required Information
Before downloading and installing the SDK, please make sure you have the following information. Contact your Implementation Manager at ASAPP if you have any questions.
| App ID | Also known as the "Company Marker", assigned by ASAPP. |
| :------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| API Host Name | The fully-qualified domain name used by the SDK to communicate with ASAPP's API. Provided by ASAPP and subject to change based on the stage of implementation. |
| Region Code | The ISO 3166-1 alpha-2 code for the region of the implementation, provided by ASAPP. |
| Supported Languages | Your app's supported languages, in order of preference, as an array of language tag strings. Strings can be in the format `{ISO 639-1 Code}-{ISO 3166-1 Code}` or `{ISO 639-1 Code}`, such as "en-us" or "en". Defaults to \["en"]. |
| Client Secret | This can be an empty or random string\* until otherwise notified by ASAPP. |
| User Identifier | A username or similar value used to identify and authenticate the customer, provided by the Customer Company. |
| Authentication Token | A password-equivalent value, which may or may not expire, used to authenticate the customer that is provided by the Customer Company. |
\* In the future, the ASAPP-provided client secret will be a string that authorizes the integrated SDK to call the ASAPP API in production. ASAPP recommends fetching this string from a server and storing it securely using Secure Storage; however, as it is one of many layers of security, you can hard-code the client secret.
## 2. Download the SDK
Download the iOS SDK from the [ASAPP iOS SDK releases page on GitHub](https://github.com/asappinc/chat-sdk-ios-release/releases).
## 3. Install the SDK
ASAPP provides the SDK as an `.xcframework` with and without bitcode in dynamic and static flavors. If in doubt, ASAPP recommends that you use the dynamic `.xcframework` with bitcode.
Add your chosen flavor of the framework to the "Frameworks, Libraries, and Embedded Content" section of your target's "General" settings.
### Include SDK Resources When Using the Static Framework
Add the provided `ASAPPResources.bundle` to your target's "Frameworks, Libraries, and Embedded Content" and then include it in your target's "Copy Bundle Resources" build phase.
The SDK allows customers to take and upload photos, [unless you disable these features through configuration](https://docs-sdk.asapp.com/api/chatsdk/ios/latest/Classes/ASAPP.html#/Permissions). Since iOS 10, Apple requires descriptions for why your app uses the photo library and/or camera, which Apple displays to the customer. If you haven't already, you'll need to add these descriptions to your app's `Info.plist`.
* If you access `Info.plist` via Xcode's plist editor, the description keys are "Privacy - Camera Usage Description" and "Privacy - Photo Library Usage Description".
* If you access `Info.plist` via a text editor, the keys are "NSPhotoLibraryUsageDescription" and "NSCameraUsageDescription".
### Validate iOS SDK Authenticity
ASAPP uses GPG (GNU Privacy Guard) for creating digital signatures. To install on macOS:
1. Using [Homebrew](https://brew.sh), install gpg:
`brew install gpg`
2. Download the [ASAPP SDK Team public key](https://docs-sdk.asapp.com/api/chatsdk/ios/security/asapp_public.gpg).
3. Add the key to GPG:
`gpg --import asapp_public.gpg`
Optionally, you can also validate the public key. Please refer to the [GPG documentation](https://www.gnupg.org/documentation/manuals.html) for more information.
Then, you can verify the signature using:
`gpg --verify <-sdk-filename>.sig `
ASAPP provides the signature alongside the SDK in each release.
## 4. Configure the SDK
Use the code below to create a config, initialize the SDK with the config, and set an anonymous user. Refer to the aforementioned [Required Information](#1-gather-required-information-15931 "1. Gather Required Information") for more details. ASAPP recommends that you initialize the SDK on launch in `application(_:didFinishLaunchingWithOptions…)`. Please see the [User Authentication](/agent-desk/integrations/ios-sdk/user-authentication "User Authentication") section for details about how to authenticate an identified user.
```json theme={null}
import ASAPPSDK
let config = ASAPPConfig(appId: appId,
apiHostName: apiHostName,
clientSecret: clientSecret,
regionCode: regionCode)
ASAPP.initialize(with: config)
ASAPP.user = ASAPPUser(nil, requestContextProvider: { _ in return [:] })
```
## 5. Open Chat
Once the SDK has been initialized with a config and a user has been set, you can create a chat view controller that can then be pushed onto the navigation stack. ASAPP recommends doing so when a navigation bar button is tapped.
```json theme={null}
let chatViewController =
ASAPP.createChatViewControllerForPushing(fromNotificationWith: nil)!
navigationController?.pushViewController(chatViewController, animated: true)
```
If you prefer to present the chat view controller as a modal, use the `ForPresenting` method instead:
```json theme={null}
let chatViewController =
ASAPP.createChatViewControllerForPresenting(fromNotificationWith: nil)!
present(chatViewController, animated: true, completion: nil)
```
Once the chat interface is open, you should see an initial state similar to the one below:
# iOS SDK Release Notes
Source: https://docs.asapp.com/agent-desk/integrations/ios-sdk/ios-sdk-release-notes
The scrolling window below shows release notes for ASAPP's iOS SDK.
This content may also be viewed as a stand-alone webpage here: [https://docs-sdk.asapp.com/api/chatsdk/ios/releasenotes](https://docs-sdk.asapp.com/api/chatsdk/ios/releasenotes)
# Miscellaneous APIs
Source: https://docs.asapp.com/agent-desk/integrations/ios-sdk/miscellaneous-apis
## Conversation Status
Call `ASAPP.getChatStatus(success:failure:)` to get the current conversation status. The first parameter of the success handler provides a count of unread messages, while the second indicates whether the chat is live. If `isLive` is true, it means the customer is currently connected to a live customer support agent, even if the user isn't currently on the chat screen or the application is in the background.
**Example:**
```json theme={null}
ASAPP.getChatStatus(success: { unread, isLive in
DispatchQueue.main.async { [weak self] in
self?.updateBadge(count: unread, isLive: isLive)
}
}, failure: { error in
print("Could not get chat status: \(error)")
})
```
## Debug Logs
To allow the SDK to print more debugging information to the console, set `ASAPP.debugLogLevel` to.debug. Please see [`ASAPPLogLevel`](https://docs-sdk.asapp.com/api/chatsdk/ios/latest/Enums/ASAPPLogLevel.html) for more options and make sure to set the level to `.errors` or `.none` in release builds.
Example:
```json theme={null}
#if DEBUG
ASAPP.debugLogLevel = .debug
#else
ASAPP.debugLogLevel = .none
#endif
```
## Clear the Persisted Session
To clear the session persisted on disk, call `ASAPP.clearSavedSession()`. This will also disable push notifications to the customer.
## Set an Intent
To open chat with an initial intent, call one of the two functions below, passing in a dictionary specifying the intent in a format provided by ASAPP. Please ask your Implementation Manager for details.
### Create a Chat View Controller with an Initial Intent
```json theme={null}
let chat = ASAPP.createChatViewControllerForPushing(withIntent: [“Code”:
“EXAMPLE_INTENT”])
or
let chat = ASAPP.createChatViewControllerForPresenting(withIntent:
[“Code”: “EXAMPLE_INTENT”])
```
To set the intent while chat is already open, call `ASAPP.setIntent(_:)`, passing in a dictionary as described above. This should only be called if a chat view controller already exists.
## Handle Chat Events
Certain agreed-upon events may occur during chat. To react to these events, implement the `ASAPPDelegate` protocol, including the `chatViewControllerDidReceiveChatEvent(name:data:)` method. Please ask your Implementation Manager if you have questions regarding chat event names and data.
## Send
This API is primarily used to send information that is used to show a proactive chat prompt when a specific criteria or set of criteria are met. To use and trigger this API, create data structure like below and call ASAPP.updateCustomerDataInfo() method.
```json theme={null}
let customerInfo: [String: Any] = [
"CustomerInfo": [
"key1": "value1"
"OrangeKey": "A Key",
"FirstName": "A name",
"key4": "value4"
]
]
ASAPP.updateCustomerDataInfo(customerParams: customerInfo)
```
This API is primarily used to send information that is used to show a proactive chat prompt.
## Custom Chat Events
To track the 'end of a chat', or add custom codes on 'new issue' and 'agent assigned', implement the following custom events.
‘eventName’: Name of the chat event.
‘issueId’: The ASAPP identifier for an individual issue. This ID may change as a user completes and starts new queries to the ASAPP system.
‘customerId’: The ASAPP identifier for a customer. This ID is consistent for authenticated users but may be different for anonymous ones. Anonymous users will have a consistent ID for the duration of their session.
‘eventTime’: The time the event occurred.
‘eventId’: The ASAPP identifier for the event.
‘externalSenderId’: The external identifier you provide to ASAPP that represents an agent identifier. This property will be undefined if the user is not connected with an agent.
```json theme={null}
func chatViewControllerDidReceiveChatCustomEvents(eventData: [String: Any]?) {
if let eventDetails = eventData {
let issueId = eventDetails["issueId"] as? Int64
let customerId = eventDetails["customerId"] as? Int64
let eventTime = eventDetails["eventTime"] as? Double
let eventId = eventDetails["eventId"] as? String
let externalSenderId = eventDetails["externalSenderId"] as? String
let eventName = eventDetails["eventName"] as? String
if eventName == "issue:end" {
//This code block will be triggered when a chat conversation is ended
} else if eventName == "issue:new" {
//This code block will be triggered when a user taps “New Question” or new issue is created
} else if eventName == "agent:assigned" {
//This code block will be triggered when a new agent has been assigned
}
}
}
```
# Push Notifications
Source: https://docs.asapp.com/agent-desk/integrations/ios-sdk/push-notifications
## Get Started with Push Notifications
Please see Apple's documentation on the [Apple Push Notification service](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/APNSOverview#//apple_ref/doc/uid/TP40008194-CH8-SW1) and the [User Notifications](https://developer.apple.com/documentation/usernotifications) framework.
## ASAPP Push Notifications
ASAPP's systems may trigger push notifications at certain times, such as when an agent sends a message to a customer who does not currently have the chat interface open. These push notifications are triggered by ASAPP's servers calling your company's API with data that identifies the recipient's device; ASAPP's servers do not communicate with APNs directly. Therefore, we provide methods in the SDK to register and deregister the customer's device for ASAPP push notifications.
For a deeper dive on how push notifications are handled between ASAPP and your company's API, please see our documentation on [Push Notifications and the Mobile SDKs](../push-notifications-and-the-mobile-sdks "Push Notifications and the Mobile SDKs").
### Enable Push Notifications
To enable push notifications for the current user when using the token provided by APNs in `didRegisterForRemoteNotificationsWithDeviceToken(_:)`, call `ASAPP.enablePushNotifications(with deviceToken: Data)`.
To enable push notifications using an arbitrary string that uniquely identifies the device and current user, call `ASAPP.enablePushNotifications(with uuid: String)`.
### Disable Push Notifications
To disable push notifications for the current user on the device, call `ASAPP.disablePushNotifications(failure:)`. The failure handler will be called in the event of an error. Make sure you call this function before you change or clear `ASAPP.user` to prevent the customer receiving push notifications that are not meant for them.
### Handle Push Notifications
Implement `application(_:didReceiveRemoteNotification:[fetchCompletionHandler:])` and pass the `userInfo` dictionary to `ASAPP.canHandleNotification(with:)` to determine if the push notification was triggered by ASAPP. If the function returns `true`, you can then pass `userInfo` to: `ASAPP.createChatViewControllerForPushing(fromNotificationWith:)`.
Your application usually won't receive push notifications from ASAPP if the user is currently connected to chat.
### Request Permissions for Push Notifications
When a user joins a queue in the ASAPP mobile app, a prompt screen asks them to enable push notifications and provides some context on the benefits. If the user has already accepted or denied these permissions, they will not receive this prompt.
After enablement, users will receive a push notification every time there is a new message in the app chat. Users only receive push notifications if the app is not active.
You can control this feature remotely. Please contact your Integration Manager for further information. ASAPP highly recommends that you enable this feature.
# User Authentication
Source: https://docs.asapp.com/agent-desk/integrations/ios-sdk/user-authentication
## Set an ASAPPUser with a Request Context Provider
As in the Quick Start section, you can connect to chat as an anonymous user by specifying a nil user identifier when initializing an `ASAPPUser`. However, many use cases might require ASAPP to know the identity of the customer.
To connect as an identified user, please specify a user identifier string and a request context provider function. This provider will be called from a background thread when the SDK makes requests that require customer authentication with your company's servers. The request context provider is a function that returns a dictionary with keys and values agreed upon with ASAPP. Please ask your Implementation Manager if you have questions.
**Example:**
```json theme={null}
let requestContextProvider = { needsRefresh in
return [
"Auth": [
"Token": "exampleValue"
]
]
}
ASAPP.user = ASAPPUser(userIdentifier: "testuser@example.com",
requestContextProvider)
```
## Handle Login Buttons
If a customer connects to chat anonymously, they may be asked to log in when necessary by being shown a message button:
If the customer then taps on the **Sign In** button, the SDK will call a delegate method: `chatViewControllerDidTapUserLoginButton()`. Please implement this method and set `ASAPP.user` once the customer has logged in. The SDK will detect the change and then authenticate the user. You may set `ASAPP.user` in any thread. Make sure to set the delegate as well: for example, `ASAPP.delegate = self`. See `ASAPPDelegate` for more details.
## Token Expiration and Refresh the Context
In the event that the provided token has expired, the SDK will call the request context provider with an argument that is true, indicating that you must refresh the context. In that case, please make sure to return a dictionary with fresh credentials that the SDK can use to authenticate the user. If the SDK requires an API call to refresh the credentials, please make sure to block the calling thread until you can return the updated context.
# Push Notifications and the Mobile SDKs
Source: https://docs.asapp.com/agent-desk/integrations/push-notifications-and-the-mobile-sdks
## Use Cases
In ASAPP Chat, users can receive Push Notifications (a.k.a. ASAPP background messages) for the following reasons:
* **New live messages**: if a customer is talking to a live agent and leaves the chat interface, the system can deliver new messages via Push Notifications.
* **Proactive messages**: used to notify customers about promotions, reminders, or other relevant information, depending on the requirements of the implementation.
If you are looking for a way to get the most recent Conversation Status, please see the [Android](/agent-desk/integrations/android-sdk/miscellaneous-apis "Miscellaneous APIs") or [iOS](/agent-desk/integrations/ios-sdk/miscellaneous-apis "Miscellaneous APIs") documentation.
## Overall Architecture
### Overview 1 - Device Token Registration
Figure 1: Push Notification Overview 1 - Device Token Registration.
### Overview 2 - Sending Push Notifications
Figure 2: Push Notification Overview 2 - Sending Push Notifications
## Device Token
After the Customer App (Figure 1) acquires the Device Token, it is then responsible to register it to the ASAPP SDK. ASAPP's servers use this token to send push notification requests to a Customer-provided API endpoint (Customer Backend), which in turn sends requests to Firebase and/or APNs.
The ASAPP SDK and servers act as the middle-man with regards to the Device Token. In general, the Device Token must be a string that uniquely identifies the device that is defined and generated by the customer.
The Device Token format and content can be customized to include the necessary information for the Customer's Backend service to send the push notifications. As an example, the Device Token can be a base64-encoded JSON Web Token (JWT) that contains the end user information required by the Customer's Backend service.
ASAPP does not need to understand the content of the Device Token; however, the ASAPP Push Notification system persists the Device Token.
Please consult with us if there is a requirement to include one or more PII data fields in the Device Token.
ASAPP's servers do not communicate directly with Firebase or APNs; it is the responsibility of the customer to do so.
## Customer Implementation
This section details the customer work necessary to integrate Push Notifications in two parts: the App and the Backend.
### Customer App
The Customer App manages the Device Token. In order for ASAPP's servers to route notifications properly, the Customer App must register and deregister the token with the ASAPP SDK.
The Customer App also detects when push notifications are received and handles them accordingly.
#### Register for Push Notifications
Please refer to Figure 1 for a high level overview. There are usually two situations where the Customer App will need to register the Device Token:
* **App start**
After you initialize the ASAPP SDK and set up the ASAPP User properly, register the Device Token.
* **Token update**
In case the Device Token changes, register the token again.
Please refer to the specific [Android](/agent-desk/integrations/android-sdk/notifications#push-notifications "Push Notifications") and [iOS](/agent-desk/integrations/ios-sdk/push-notifications "Push Notifications") docs for more detailed information.
#### Deregister for Disable Push Notifications
If the user signs out of the Customer App, it is important to call the SDK API to de-register for push notifications.
This must be done before changing the ASAPP user credentials so that the SDK can use those credentials to properly disable Push Notifications for the user who is signing out.
If the device token de-registration isn't done properly, there's risk that the device will continue to receive Push Notifications for the user who previously signed out.
Please refer to the specific [Android](/agent-desk/integrations/android-sdk/notifications#push-notifications "Push Notifications") and [iOS](/agent-desk/integrations/ios-sdk/push-notifications "Push Notifications") docs for more detailed information.
#### Receive Messages in the Foreground
If the user is currently in chat, the system sends the message directly to chat via WebSocket and sends no push notification.
See Scenario 2 in Figure 2.
On **Android**: you usually receive foreground Push Notifications via a Firebase callback. To check if this is an ASAPP-generated Push Notification, call `ASAPP.instance.getConversationStatusFromNotification`, which will return a non-null status object. The Customer App can now display user feedback as desired using the status object.
On **iOS**, if you have set a `UNUserNotificationCenterDelegate`, it calls [userNotificationCenter(\_:willPresent:withCompletionHandler:)](https://developer.apple.com/documentation/usernotifications/unusernotificationcenterdelegate/1649518-usernotificationcenter) when a push notification is received while the app is in the foreground. In your implementation of that delegate method, call `ASAPP.canHandleNotification(with: notification.request.userInfo)` to determine if ASAPP generated the notification. An alternative method is to implement [application(\_:didReceiveRemoteNotification:fetchCompletionHandler:)](https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623013-application), which is called when a push notification is received regardless of whether the app is in the foreground or the background. In both cases, you can access `userInfo["UnreadMessages"]` to determine the number of unread messages.
#### Receive Push Notifications in the Background
See Scenario 1 in Figure 2.
When the App is in the background (or the device is locked), a system push notification displays as usual.
When the user opens the push notification:
* On **Android**: the App opens with an Android Intent. The Customer App can verify if the Intent is from an ASAPP generated Push Notification by calling the utility method `ASAPP.instance.shouldOpenChat` . This should open chat. See more details and code examples in the Android SDK [Handle Push Notifications](/agent-desk/integrations/android-sdk/notifications#handle-push-notifications "Handle Push Notifications") section.
* On **iOS**: if the app is running in the background, it calls [application(\_:didReceiveRemoteNotification:fetchCompletionHandler:)](https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623013-application) as above. If the app is not running, the app will start and call [application(\_:didFinishLaunchingWithOptions:)](https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1622921-application), with the notification's payload accessible at `launchOptions[.remoteNotification]`. Once again, call `ASAPP.canHandleNotification(with:)` to determine if ASAPP generated the notification.
### Customer Backend
It is common that the Customer solution already includes middleware that handles Push Notifications. This middleware usually provides the Customer App with the Device Tokens and sends Push Notification requests to Firebase and/or APNs. If the middleware provides an endpoint that can be called to trigger push notifications, ASAPP can integrate with it (given that the authentication strategy is in place). Otherwise, ASAPP requires that the Customer provides or implements an endpoint for this to take place.
ASAPP's Push Notification adapters call the provided endpoint with a previously agreed-upon payload format. The following is a payload example:
```json theme={null}
{
authToken: "auth-token",
deviceToken: "the-device-token",
payload: {
aps: {
alert: {
title: "New Message",
body: "Hello, how can we help?"
}
},
...
},
...
}
```
## ASAPP Implementation
### ASAPP Backend
For any new Push Notification Integration, ASAPP creates an "adapter" for ASAPP's Notification Hub service. This adapter translates messages sent by Agents to a request that is compatible with the Customer Backend. This usually means that the Notification Hub adapter makes HTTP calls to the Customer's specified endpoint, with a previously agreed-upon payload format.
### ASAPP SDK
The ASAPP Android and iOS SDKs already supply the interfaces and utilities needed for Customer Apps to register and de-register for Push Notifications.
### Testing Environments and QA
From a Quality Assurance standpoint, ASAPP requires access to lower-level environments with credentials so that we can properly develop and test new adapters.
# User Management
Source: https://docs.asapp.com/agent-desk/integrations/user-management
This section provides an overview of User Management (Roles and Permissions). These roles dictate if an ASAPP user can authenticate to *Agent Desk*, *Admin Dashboard*, or both. In addition, roles determine what view and data users see in the Admin Dashboard. You pass User Data to ASAPP via *SSO*, AD/LDAP, or other approved integration.
This section describes the following:
* [Process Overview](#process-overview)
* [Resource Overview](#resource-overview)
* [Definitions](#definitions "Definitions")
## Process Overview
This is a high-level overview of the User Management setup process.
1. ASAPP demos the Desk/Admin Interface.
2. Call with ASAPP to confirm the access and permission requirements. ASAPP and you complete a Configuration spreadsheet defining all the Roles & Permissions.
3. ASAPP sends you a copy of the Configuration spreadsheet for review and approval. ASAPP will make additional changes if needed and send to you for approval.
4. ASAPP implements and tests the configuration.
5. ASAPP trains you to set up and modify User Management.
6. ASAPP goes live with your new Customer Interaction system.
## Resource Overview
The following table lists and defines all resources:
Feature
Overview
Resource
Definition
Agent Desk
The App where Agents communicate with customers.
Authorization
Allows you to successfully authenticate via Single Sign-On (SSO) into the ASAPP Agent Desk.
Go to Desk
Allows you to click Go to Desk from the Nav to open Agent Desk in a new tab. Requires Agent Desk access.
Default Concurrency
The default value for the maximum number of chats a newly added agent can handle at the same time.
Default Concurrency
Sets the default concurrency of all new users with access to Agent Desk if the ingest method did not set any concurrency.
Admin Dashboard
The App where you can monitor agent activity in real-time, view agent metrics, and take operational actions (e.g. biz hours adjustments)
Authorization
Allows you to successfully authenticate via SSO into the ASAPP Admin Dashboard.
Live Insights
Dashboard in Admin that displays how each of your queues are performing in real-time. You can drill down into each queue to gain insight into what areas need attention.
Access
Allows you to see Live Insights in the Admin navigation and access it.
Data Security
Limits the agent-level data that certain users can see in Live Insights. If a user is not allowed to see data for any agents who belong to a given queue, Live Insights will not show that queue to that user.
Historical Reporting
Dashboard in Admin where you can find data and insights from customer experience and automation all the way to agent performance and workforce management.
Power Analyst Access
Allows you to see the Historical Reporting page in the Admin Navigation with Power Analyst access type, which entails the following:
Access to ASAPP Reports
Ability to change widget chart type
Ability to toggle dimensions and filters on/off for any report
Export data per widget and dashboard
Cannot share reports to other users
Cannot create or copy widgets and dashboards
Creator Access
Allows you to see the Historical Reporting page in the Admin Navigation with Creator access type, which entails the following:
Power Analyst privileges
Can share reports
Can create net new widgets and dashboards
Can copy widgets and dashboards
Can create custom dimensions/calculated metrics
Reporting Groups
Out-of-the-box groups are:
Everybody: all users
Power Analyst: Users with Power Analyst Role
Creator: Users with Creator role
If a client has data security enabled for Historical Reporting, policies need to be written to add users to the following 3 groups:
Core: Users who can see the ASAPP Core Reports
Contact Center: Users who can see the ASAPP Contact Center Reports
All Reports: Users who can see both the ASAPP Contact Center and ASAPP Core Reports
If you have any Creator users, you may want custom groups created. This can be achieved by writing a policy to create reporting groups based on a specific user attribute (i.e. I need reporting groups per queue, where queue is the attribute).
Data Security
Limits the agent-level data that certain users can see in Historical Reporting. If anyone has these policies, then the Core, Contact Center, and All Reports groups should be enabled.
Business Hours
Allows Admin users to set their business hours of operation and holidays on a per queue basis.
Access
Allows you to see Business Hours in the Admin navigation, access it, and make changes.
Triggers
An ASAPP feature that allows you to specify which pages display the ASAPP Chat UI. You can show the ASAPP Chat UI on all pages with the ASAPP Chat SDK embedded and loaded, or on just a subset of those pages.
Access
Allows you to see Triggers in the Admin navigation, access it, and make changes.
Knowledge Base
An ASAPP feature that helps Agents access information without the needing to navigate any external systems by surfacing KB content directly within Agent Desk.
Access
Allows you to see Knowledge Base content in the Admin navigation, access it, and make changes.
Conversation Manager
Admin Feature where you can monitor current conversations individually in the Conversation Manager. The Conversation Manager shows all current, queued, and historical conversations handled by SRS, bot, or by a live agent.
Access
Allows you to see Conversation Manager in the Admin navigation and access it.
Conversation Download
Allows you to select 1 or more conversations in Conversation Manager to export to either an HTML or CSV file.
Whisper
Allows you to send an inline, private message to an agent within a currently live chat, selected from the Conversation Manager.
SRS Issues
Allows you to see conversations only handled by SRS in the Conversation Manager.
Data Security
Limits the agent-assisted conversations that certain users can see at the agent-level in the Conversation Manager.
User Management
Admin Feature to edit user roles and permissions.
Access
Allows you to see User Management in their Admin navigation, access it, and make changes to queue membership, status, and concurrency per user.
Editable Roles
Allows you to change the role(s) of a user in User Management.
Editable Custom Attributes
Allows you to change the value of a custom user attribute per user in User Management. If Off, then these custom attributes will be read-only in the list of users.
Data Security
Limits the users that certain users can see or edit in User Management.
## Definitions
The following table defines the key terms related to ASAPP Roles & Permissions.
Role
Definition
Resource
The ASAPP functionality that you can permission in a certain way. ASAPP determines Resources when features are built.
Action
Describes the possible privileges a user can have on a given resource. (i.e. View Only vs. Edit)
Permission
Action + Resource. ex. "can view Live Insights"
Target
The user or a set of users who are given a permission.
User Attribute
A describing attribute for a client user. User Attributes are either sent to ASAPP via accepted method by the client, or ASAPP Native.
ASAPP Native User Attribute
A user attribute that exists within the ASAPP platform without the client needing to send it. Currently:
Role
Group
Status
Concurrency
Custom User Attribute
An attribute specific to the client's organization that is sent to ASAPP.
Clarifier
An additional and optional layer of restriction in a policy. Must be defined by a user attribute that already exists in the system.
Policy
An individual rule that assigns a permission to a user or set of users. The structure is generally: Target + Permission (opt. + Clarifier) = Target + Action + Resource (opt. + Clarifier)
# Voice
Source: https://docs.asapp.com/agent-desk/integrations/voice
The ASAPP Voice Agent Desk includes web-based agent-assist services, which provide telephone agents with a machine learning and natural-language processing powered desktop. Voice Agent Desk augments the agent's ability to respond to inbound telephone calls from end customers.
Voice Agent Desk augments the agents by allowing quick access to relevant customer information and provides actionable suggestions that ASAPP infers from analyzing the ongoing conversation. The content, actions, and responses ASAPP provides to agents augment the agent's ability to respond quickly and more effectively to end customers.
Voice Agent Desk interfaces with relevant customer applications to enable desired features.
The ASAPP Voice Agent Desk is not in the call-path but is more of an active listener, and uses two different integrations to provide the real-time augmentation:
* [SIPREC](#glossary "Glossary") - you enable SIP RECording on the customer [Session Border Controllers (SBC)](#glossary "Glossary") and route a copy of the media stream, call information, and metadata per session to ASAPP.
* [CTI](#glossary "Glossary") Events - ASAPP subscribes to telephony events of the voice agents via the CTI server (login, logout, on-hook, off-hook, etc.)
ASAPP associates and aggregates the media sessions and CTI events within the ASAPP solution and uses them to power the agent augmentation features presented in Voice Agent Desk to the agents.
The ASAPP Voice Agent Desk solution provides agents with the real-time features that automate many of their repeatable tasks. Agents can use Voice Agent Desk for:
* The real-time transcript
* Conversation Summary - where agents add notes and structured data tags that ASAPP suggests as well as disposition the call during the interaction and once it is complete.
* Agents login to Voice Agent Desk via the customer's SSO.
* Customer information (optional)
* Knowledge Base integration (optional)
## Customer Current State Solution
ASAPP works with you to understand your current telephony infrastructure and ecosystem, including the type of voice work assignment platform/s and other capabilities available, such as SIPREC.
## Solution Architecture
After ASAPP completes the discovery of the customer's current state, ASAPP completes the architecture definition, including integration points into the existing infrastructure. You can deploy the ASAPP [media gateways and media gateway proxies](#glossary "Glossary") within your existing AWS instance or within ASAPP's, providing additional flexibility and control.
### Network Connectivity
ASAPP will determine the network connectivity between your infrastructure and the ASAPP AWS Virtual Private Cloud (VPC) based on the architecture, however, ASAPP will deploy secure connections between your data centers and the ASAPP VPC.
### Port Details
You can see ports and protocols in use for the Voice implementation depicted in the following diagram. These definitions provide visibility to your security teams for the provisioning of firewalls and ACL's.
* SIP/SIPREC - TCP (5060, 5070-5072)
* SBC to Media Gateway Proxies
* SBC to Media Gateway/s
* Audio Streams - UDP \
* CTI Event Feed - TCP \
* API Endpoints - TCP 443
In customer firewalls, disable the [SIP Application Layer Gateway (ALG)](#glossary "Glossary") and any 'Threat Detection' features, as they typically interfere with the SIP dialogs and the re-INVITE process.
### Data Flow
The Voice Agent Desk Data Flow diagram illustrates the [PCI Zone](#glossary "Glossary") within the ASAPP solution. The customer SBC originates the SIPREC sessions and the media streams and sends them to ASAPP media gateways, which repackage the streams into secure WebSockets and send them to the [Voice Streamer](#glossary "Glossary") within the PCI zone. ASAPP encrypts the data in transit and at rest.
The SBC does not typically encrypt the SIPREC sessions and associated media streams from the SBC to the ASAPP media gateways, but usually encapsulates them within a secure connection. You are responsible for the compliance/security of the network path between the SBC and the media gateways, in accordance with applicable customer policies.
## SIPREC and CTI Correlation and Association
In order to be able to associate the correct audio stream and the correct agent and agent desktop, ASAPP must associate the audio session and the CTI events of the particular agent.
ASAPP assigns voice agents a unique Agent ID and adds it to the SSO profile as a custom attribute. ASAPP will then map this to the Agent ID within ASAPP.
You configure the SBCs to set a unique call identifier, such as [UCID](#glossary "Glossary") (Avaya) or [GUID](#glossary "Glossary")/GUCID (Cisco), etc. on inbound calls, which provides ASAPP the means to correlate the individual SIPREC stream with the CTI events of the correct agent.
The SBCs will initiate a SIPREC session INVITE for each new call. With SIPREC, the customer SBC and the ASAPP media gateway negotiate the media attributes via the [SDP](#glossary "Glossary") offer/answer exchange during the establishment of the session. The codec/s in use today are:
1. G.711
2. G.729
Traffic and load considerations:
* Total number of voice agents using ASAPP -\
* Maximum concurrently logged in agents \
* Maximum concurrent calls at each SBC pair -\
* Maximum calls per second at each SBC pair -\
### Load Balancing for ASAPP Media Gateway Proxies
In order to distribute traffic across all of the media gateway proxies, the SBCs load balance the SIPREC dialogs to the ASAPP MG Proxies. To facilitate this, you configure the SBCs with a proxy list that provides business continuity and enables fail-over to the next available proxy if one of the proxies becomes unavailable.
Session Recording Group Example:
The customer data center SBCs use different orders for the media gateway proxy list.
Data Center 1:
1. MG Proxy #1
2. MG Proxy #2
3. MG Proxy #3
Data Center 2:
1. MG Proxy #3
2. MG Proxy #2
3. MG Proxy #1
## Media Failover and Survivability
### Session Border Controller (SBC) to Media Gateways (MG) and Proxies
* Typically unencrypted signaling and audio through a secure connection/private tunnel
* You can encrypt the traffic in theory, but the SBC has costs and scale limitations associated with encrypting traffic, as well as cost increases to MGs as you will need more instances.
* ASAPP accepts SIPREC dialogs, but initially sets SDP media to "inactive," which pauses the audio while in the IVR and in queue.
* The ASAPP media gateway will re-invite the session and re-negotiate the media parameters to resume the audio stream when the agent answers the call.
* SIP RFC handles some level of packet loss and re-transmissions but if the SIP signal is lost, the SIPREC dialog will be torn down and the media will no longer be sent.
* Media is sent via UDP.
* No retransmissions so packet loss or disconnects result in permanent loss of the audio.
* Proxies are transactionally stateless.
* No audio is ever sent to/through proxies, all audio goes directly to media gateways.
* Proxies are no longer in the signal path after the first transaction.
* If a proxy fails or is disconnected, SBCs can "hunt" or failover to the next proxy in it's configuration.
* No existing calls are impacted.
* If media gateways fail or are disconnected, the next SIP transaction will fail and the existing media stream (if resumed) will send via UDP to nothing (media is lost).
* Media gateways use regular SIP OPTIONS sent to static proxies that indicate if they are available and their current number of calls.
* Proxies use this active call load to evenly load balance to the least used media gateway.
* As well as dynamically pick up when a media gateway is no longer available or new ones come online.
* Any inbound calls coming in over ISDN-PRI/TDM trunk facilities will not have associated SIPREC sessions, as these calls do not traverse the SBC.
### Media Gateways to ASAPP Voice Streamers
* Secure websocket initiated per stream (2 per call) to the ASAPP Voice Streamer
* Media gateways do not store media, all processing is done in memory.
* Packet loss can be tolerated a little with TCP retransmissions.
* Buffer overrun audio data in the media gateway is purged instantly (per stream).
* If a secure websocket connection is lost, the media gateway will attempt a limited number of reconnections and then fail.
* If a voice streamer fails, a media gateway will reconnect to a new streamer.
* If a media gateway fails, the SIPREC stream is lost and the SBC can no longer send audio for that group of calls.
## Integration
### API Integration
Integration to existing customer systems enable ASAPP to call for information from those systems to present to the agent, such as:
* customer profile information
* billing history/statements
* customer product purchases
* Knowledge Base
Integration also enables ASAPP to push information to those systems, such as disposition notes and account changes/updates.
ASAPP will work with you to determine use cases for each integration that will add value to the agent and customer experience.
### Custom Call Data from CTI Information
In many instances, CTI will carry end customer specific information about the end customer and the call. This may be in the form of [User-to-User Information (UUI)](#glossary "Glossary"), `Call Variables`, Custom `NamedVariables`, or Custom `KVList UserData`. ASAPP uses this data to provide more information to agents and admins. It may contain information that provides customer identity information, route codes, queue information, customer authentication status, IVR interactions/ outputs, or simply unique identifiers for further data lookup from APIs. ASAPP extracts the custom fields and leverages the data in real-time to provide agents as much information as possible as part of the initial part of the interaction.
Each environment is uniquely different and ASAPP needs to understand what data is available from the CTI events to maximize relevant data to the agent and for voice intelligence processing.
Examples:
**Avaya**
```json theme={null}
UserToUserInfo: “10000002321489708161;verify=T;english;2012134581”
```
**Cisco**
```json theme={null}
CallVariable1:10000002321489708161
CallVariable7:en-us
user.AuthDetect:87
```
**Genesys**
```json theme={null}
userAccount:10000002321489708161
userLanguage:en
userFirstName:John
```
**Twilio**
```json theme={null}
```
### SSO Integration
[Single Sign-On (SSO)](#glossary "Glossary") allows users to sign in to ASAPP using their existing corporate credentials. ASAPP supports [Security Assertion Markup Language](#glossary "Glossary") (SAML) 2.0 Identity Provider (IdP) based authentication. ASAPP requires SSO integration to support implementation.
To enable the SSO integration, the customer must populate and pass the Agent Login ID as a custom attribute in the SAML payload. Then, when a user logs in to ASAPP and authenticates via the existing SSO mechanism, the Agent Login ID value is then passed to ASAPP via SAML assertion for subsequent CTI event correlation.
The ASAPP Voice Agent Desk supports role-based access. You can define a specific role for each user that will determine their permissions within the ASAPP platform. For example, you can define the "app-asappagentprod" role in the Active Directory to send to ASAPP via SAML for those specific users that should have access to ASAPP Voice Agent Desk only. You can define multiple roles for an agent, such as access to Voice Agent Desk, Digital Agent Desk, and Admin Desk. You must define roles for voice agents and supervisors and include them in the SAML payload as a custom attribute.
The table below provides examples of SAML user attributes.
SAML Attribute Values
ASAPP Usage
Examples
Agent Login ID
Provides mapping of the customer telephony agent ID to ASAPP’s internal user ID.
user.extensionattribute1
or
cti\_agent\_id
Givenname
Given name
user.givenname
Surname
Surname
user.surname
Mail
Email address
user.mail
Unique User Identifier
The User ID (authRepId); can be represented as an employee ID or email address.
user.employeeid or user.userprincipalname
PhysicalDeliveryOfficeName
Physical delivery office name
user.physicaldeliveryofficename
HireDate
Hire date attribute used by reporting.
HireDate
Title
Can be used for reporting.
Title
Role
The roles define what agents can see in the UI and have access to when they login.
user.role app-asappadminprod app-asappagentprod
Group
For Voice, this is only for reporting purposes. For digital chat this also can be used for queue management.
user.groups
## Call Flows
Once an inbound [Automatic Call Distribution (ACD)](#glossary "Glossary") call is connected to an agent, the agent may need to transfer or conference the customer in with another agent/skill group. It is important to identify and document these types of call flows, when the transcript and customer data needs to be provided to another agent due to a change in call state. Then ASAPP will test these call scenarios as part of the QA and UAT testing process.
These scenarios include:
* Cold Transfers
* The agent transfers the call to a queue (or similar) but does not stay on the call.
* Warm Transfers
* The agent talks to the receiving agent prior to completing the transfer, in order to prepare the agent with the context of the call/customer issue.
* Conferences
* The agent conferences in another agent or supervisor and remains on the call.
* Other
* Customer call back applications or other unique call flows.
## Speech Files for Model Training
To prepare for a production launch, ASAPP will train the speech models on the customer language and vocabulary, which will provide better transcription accuracy. ASAPP will use a set of customer call recordings from previous interactions.
You will need to provide ASAPP with a minimum of 1,000 hours of agent/customer dual-channel/speech separated media files in .wav format with a sample rate of 8000 and signed 16-bit [Pulse-Code Modulation (PCM)](#glossary "Glossary") in order for ASAPP to train the speech recognition models.
* ASAPP will set up an SFTP site in our PCI zone to receive voice media files from you. You will provide an SSH public key and ASAPP will configure the SFTP location within S3.
* ASAPP prefers that you redact the PCI data from the provided voice recordings. Regardless, ASAPP will use its media redaction technology to remove sensitive customer data (Credit Card Numbers and Social Security Numbers) from the recordings to the extent possible. In addition to the default redaction noted above, ASAPP can customize redaction criteria per your requirements and feature considerations.
* The unredacted voice media files will remain within the [PCI Zone](#glossary "Glossary").
* ASAPP will use a combination of automated and manual transcription to refine our speech models. Data that ASAPP shares with vendors goes through the redaction process described above and is transferred via secured mechanisms such as SFTP.
## Non-Production Lower Environments
As part of our implementation strategy, ASAPP will implement two lower environments for testing (UAT and QA) by both ASAPP and customer resources. It is important that the lower environments do not use production data, including the audio data, as it may contain PCI information or other customer information that you should not expose to the lower environments.
You can implement lower environments using a lab environment, or a production environment.
When using the production infrastructure to support the lower environments, ASAPP separates production traffic from the lower environment traffic. The lower environments will have dedicated inbound numbers and routing that will allow them to be isolated and provide the ability for ASAPP and the customer teams to fully test using non-production traffic.
As part of the environment's buildout, ASAPP will need a way to initiate and terminate test calls. The ASAPP team will use the same soft-client and tools used by agents to login as a voice agent, answer inbound test calls, and simulate the various call flows used within the customer contact center.
ASAPP proposes customers allocate two [Direct Inward Dialing](#glossary "Glossary") (DID)/ [Toll Free Number](#glossary "Glossary") (TFN) numbers, one for each of the two different test environments.
* Demo Environment - A lower environment used by both ASAPP and customers.
* Preprod Environment - A lower environment used by ASAPP QA for testing.
At the SBC level, you should configure the Demo and Preprod DID numbers with their own Session Recording Server (SRS), unique from the production SRS configuration. This will allow the test environments to always have SIPREC turned on, but not send excess/production traffic to ASAPP. This also allows the test environments to operate independently of production. With Oracle/Acme, you can accomplish this with session agents. For Avaya SBCE, you can accomplish this with End Point Flows.
ASAPP will have a separate set of media gateways and media gateway proxies for each environment to ensure traffic and data separation.
The lower environments (not PCI compliant) are for testing only and will not receive actual customer audio. The production environment is where ASAPP transcribes and redacts the audio in a PCI zone.
## Appendix A - Avaya Configuration Details
This section provides specific configuration details for the solution that leverages Avaya telephony infrastructure.
**Avaya Communication Manager**
* Set Avaya [Internet Protocol - Private Branch Exchange (IP-PBX)](#glossary "Glossary") SIP trunks to 'shared' to ensure the UCID is not reset by the PBX.
* Change trunk-group x -> page 3 -> UUI Treatment:shared
* Set `SendtoASAI` parameter to 'yes.'
* Change system-parameters features -> page 13 -> Send UCID to ASAI? Y
* Add ASAPP voice agents to a new skill, one that is not used for queuing or routing.
* Configure AES to monitor the new skill.
* ASAPP will use the `cstaMonitorDevice` service to monitor the ACD skill.
* ASAPP may also call `cstaMonitorCallsViaDevice` if more call data is needed.
**Avaya AES [TSAPI](#glossary "Glossary") configuration**
* Networking -> Ports -> TSAPI Ports
* Enabled
* TSAPI Service Port (450)
* Firewalls will also need to allow these ports.
| **Connection Type** | **TCP Min Port** | **TCP Max Port** |
| :------------------ | :--------------- | :--------------- |
| unencrypted/TCP | 1050 | 1065 |
| encrypted/TLS | 1066 | 1081 |
* AES link to ASAPP connection provisioning
* Provisioning of new ASAPP Voice skill for monitoring.
## Appendix B - Cisco Configuration Details
This section provides specific configuration details for the solution that leverages Cisco telephony infrastructure.
**Cisco CTI Server configuration**
* ASAPP will connect with the `CTI_SERVICE_ALL_EVENTS`
* You will need the Preferred `ClientID` (identifier for ASAPP) and `ClientPassword` (if not null) to send the `OPEN_REQ` message.
* Ports 42027 (side A) and 43027 (side B)
* Instance number if not 0 will increase these ports
* Firewalls will also need to allow these ports
* `CallVariable`1-10 Definitions/usages
* Custom `NamedVariables` and `NamedArrays` Definitions/usages
* Events currently used by ASAPP:
* `OPEN_REQ`
* `OPEN_CONF`
* `SYSTEM`
* `AGENT_STATE`
* `AGENT_PRE_CALL`
* `BEGIN_CALL`
* `CALL_DATA_UPDATE`
* `CALL_CLEARED`
* `END_CALL`
## Appendix C - Oracle (Acme) Session Border Controller
In order to provide the correlation between the SIPREC session and specific CTI events, ASAPP will use the following approach:
* Session Border Controller
* Configure the SBC to create an Avaya UCID (universal call identifier) in the SIP header.
* UCID generation is a native feature for Oracle/Acme Packet session border controller platforms.
* [Oracle SBC UCID Admin](https://docs.oracle.com/en/industries/communications/enterprise-session-border-controller/8.4.0/configuration/universal-call-identifier-spl#GUID-97456BB9-264F-4290-AB92-8C60F64B9734)
* In the Oracle (Acme Packet) SBCs, load balancing across the ASAPP Media Gateway Proxies requires the use of static IP addresses versus the use of dynamic hostnames.
* SBC Settings for Media Gateway Proxies - Production and Lower Environments:
* Transport = TCP
* SIP OPTIONS = disabled
* Load Balancing strategy = "hunt"
* Session-recording-required = disabled
* Port = 5070
## Glossary
| **Term** | **Acronym** | **Definition** |
| :-------------------------------------------------------- | :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Automated Speech Recognition** | ASR | The service that converts speech (audio) to text. |
| **Automatic Call Distributor** | ACD | A telephony system that automatically receives incoming calls and distributes them to available agents. Its purpose is to help inbound contact centers sort and manage large volumes of calls to avoid overwhelming the team. |
| **Computer Telephony Integration** | CTI | The means of linking a call center's telephone systems to a business application. In this case, ASAPP monitors agents and receives call state event data via CTI. |
| **Direct Inward Dialing** | DID | A service that allows a company to provide individual phone numbers for each employee without a separate physical line. |
| **Globally Unique IDentifier** | GUID | A numeric label used for information in communications systems. When generated according to the standard methods, GUIDs are, for practical purposes, unique. Also known as Universally Unique IDentifier (UUID) |
| **Internet Protocol Private Branch Exchange** | IP-PBX | A system that connects phone extensions to the Public Switched Telephone Network (PSTN) and provides internal business communication. |
| **Media Gateway** | MG | Entry point for all calls from Customer. Receives and forwards SIP and audio data. |
| **Media Gateway Proxy** | MGP | SIP Proxy, used for SIP signaling to/from customer SBC. |
| **Payment Card Industry Data Security Standard** | PCI DSS | Payment card industry compliance refers to the technical and operational standards that businesses follow to secure and protect credit card data provided by cardholders and transmitted through card processing transactions. |
| **Payment Card Industry Zone** | PCI Zone | PCI Level I Certified environment for cardholder data and other sensitive customer data storage (Transport layer security for encryption in transit, encryption at rest, access tightly restricted and monitored). |
| **Pulse-Code Modulation** | PCM | Pulse-code modulation is a method used to digitally represent sampled analog signals. It is the standard form of digital audio in digital telephony. |
| **Security Assertion Markup Language** | SAML | An open standard for exchanging authentication and authorization data between an identity provider and a service provider. |
| **Session Border Controller** | SBC | SIP-based voice security platform; source of the SIPREC sessions to ASAPP. |
| **Session Description Protocol** | SDP | Used between endpoints for negotiation of network metrics, media types, and other associated properties, such as codec and sample size. |
| **Session Initiation Protocol Application-Level Gateway** | SIP ALG | A firewall function that enables the firewall to inspect the SIP dialog/s. This function should be disabled to prevent SIP dialog interruption. |
| **Session Initiation Protocol Recording** | SIPREC | IETF standard used for establishing recording sessions and reporting of the metadata of the communication sessions. |
| **Single Sign On** | SSO | Single sign-on is an authentication scheme that allows a user to log in with a single ID and password to any of several related, yet independent, software systems. |
| **Toll-Free Number** | TFN | A service that allows callers to reach businesses without being charged for the call. The called person is charged for the toll-free number. |
| **Telephony Services API** | TSAPI | Telephony server application programming interface (TSAPI) is a computer telephony integration standard that enables telephony and computer telephony integration (CTI) application programming. |
| **Universal Call IDentifier** | UCID | UCID assigns a unique number to a call when it enters that call center network. The single UCID can be passed among platforms, and can be used to compile call-related information across platforms and sites. |
| **User to User Information** | UUI | The SIP UUI header allows the IVR to insert information about the call/caller and pass it to downstream elements, in this case, Communication Manager. The UUI information is then available via CTI. |
| **Voice Streamer** | VS | Receives SIP and audio data from MG. Gets the audio transcribed into text through the ASR and sends that downstream. |
# Web SDK Overview
Source: https://docs.asapp.com/agent-desk/integrations/web-sdk
Welcome to the ASAPP Chat SDK Web Overview!
This document provides an overview of how to integrate the SDK (authenticate, customize, display) and the various API methods and properties you can use to call the ASAPP Chat SDK. In addition, it provides an overview of the ASAPP ContextProvider, which allows you to pass various user information to the Chat SDK.
If you're just getting started with the ASAPP Chat SDK, ASAPP recommends starting with the [Web Quick Start](/agent-desk/integrations/web-sdk/web-quick-start "Web Quick Start") section. There you will learn the basics of embedding the ASAPP Chat SDK and how to best align it with your site.
ASAPP functionality can be integrated into your website simply, by making sure that a snippet of javascript is included in your site template.
The subsections below provide both an integration overview and detailed documentation covering everything from how to easily get started with your ASAPP integration through how to implement arbitrarily fine-grained customization of the look and feel and the functioning of ASAPP technology to meet your design and functional requirements.
The Web SDK Overview includes the following sections:
* [Web Quick Start](/agent-desk/integrations/web-sdk/web-quick-start "Web Quick Start")
* [Web Authentication](/agent-desk/integrations/web-sdk/web-authentication "Web Authentication")
* [Web Customization](/agent-desk/integrations/web-sdk/web-customization "Web Customization")
* [Web Features](/agent-desk/integrations/web-sdk/web-features "Web Features")
* [Web JavaScript API](/agent-desk/integrations/web-sdk/web-javascript-api "Web JavaScript API")
* [Web App Settings](/agent-desk/integrations/web-sdk/web-app-settings "Web App Settings")
* [Web ContextProvider](/agent-desk/integrations/web-sdk/web-contextprovider "Web ContextProvider")
* [Web Examples](/agent-desk/integrations/web-sdk/web-examples "Web Examples")
# Web App Settings
Source: https://docs.asapp.com/agent-desk/integrations/web-sdk/web-app-settings
This section details the various properties you can provide to the Chat SDK.
These properties are used for various display, feature, and application settings.
Before utilizing these settings, make sure you've [integrated the ASAPP SDK](/agent-desk/integrations/web-sdk/web-quick-start "Web Quick Start") script on your page.
Once you've integrated the SDK with your site, you can use the [JavaScript API](/agent-desk/integrations/web-sdk/web-javascript-api "Web JavaScript API") for applying these settings.
The properties available to the ASAPP Chat SDK include:
* [APIHostName](#apihostname "APIHostName")
* [AppId](#appid "AppId")
* [ContextProvider](#contextprovider "ContextProvider")
* [CustomerId](#customerid "CustomerId")
* [Display](#display "Display")
* [Chat](#chat "Chat")
* [Intent](#intent "Intent")
* [Language](#language)
* [onLoadComplete](#onloadcomplete "onLoadComplete")
* [RegionCode](#regioncode "RegionCode")
* [Sound](#sound "Sound")
* [UserLoginHandler](#userloginhandler-11877 "UserLoginHandler")
Each property has three attributes:
* Key - provides the name of the property that you can set.
* Available APIs - lists the [JavaScript APIs](/agent-desk/integrations/web-sdk/web-javascript-api "Web JavaScript API") that the property is accepted on.
* Value Type - describes the primitive type of value required.
## APIHostName
* Key: `APIHostName`
* Available APIs: [Load](/agent-desk/integrations/web-sdk/web-javascript-api#load "'load'")
* Value Type: `String`
Sets the ASAPP APIHostName for connecting customers with customer support.
## AppId
* Key: `AppId`
* Available APIs: [Load](/agent-desk/integrations/web-sdk/web-javascript-api#load "'load'")
* Value Type: `String`
Your unique Company Identifier.
## Chat
* Key: `Chat`
* Available APIs: [Load](/agent-desk/integrations/web-sdk/web-javascript-api#load)
* Value Type: `Object`
The `Chat` setting allows you to customize the:
* [Styling](/agent-desk/integrations/web-sdk/web-customization#dynamic-styling-configuration)
* [Icons](/agent-desk/integrations/web-sdk/web-customization#custom-icons)
* [Features](/agent-desk/integrations/web-sdk/web-customization#chat-features)
## ContextProvider
* Key: `ContextProvider`
* Available APIs: [Load](/agent-desk/integrations/web-sdk/web-javascript-api#load "'load'"), ['setCustomer'](/agent-desk/integrations/web-sdk/web-javascript-api#setcustomer "'setCustomer'")
* Value Type: `Function`
The ASAPP `ContextProvider` is used for passing various information about your users to the Chat SDK. This information may include authentication, analytics, or session information. Please see the in-depth section on [Using the ContextProvider](/agent-desk/integrations/web-sdk/web-contextprovider "Web ContextProvider") for details about each of the use cases.
## CustomerId
* Key: `CustomerId`
* Available APIs: [Load](/agent-desk/integrations/web-sdk/web-javascript-api#load "'load'"), ['setCustomer'](/agent-desk/integrations/web-sdk/web-javascript-api#setcustomer "'setCustomer'")
* Value Type: `String`
The unique identifier for an authenticated customer. This value is typically a customer's login name or account ID. If setting a **`CustomerId`** you must also provide a [ContextProvider ](#contextprovider "ContextProvider")property to pass along their access token and any other required authentication properties.
## Display
* Key: `Display`
* Available APIs: [Load](/agent-desk/integrations/web-sdk/web-javascript-api#load "'load'")
* Value Type: `Object`
The `Display` setting allows you to customize the presentation aspects of the Chat SDK. The setting is an object that contains each of the customization's you wish to provide.
Read on below for the currently supported keys:
```javascript theme={null}
ASAPP('load',
{ "APIHostname": "example-co-api.asapp.com",
"AppId": "example-co",
"Display": {
"Align": "left",
"AlwaysShowMinimize": true,
"BadgeColor": "rebeccapurple",
"BadgeText": "Support",
"BadgeType": "tray",
"FrameDraggable": true,
"FrameStyle": "sidebar",
"HideBadgeOnLoad": false,
"Identity": "electronics"
}
}
```
### Align
* Key: `Align`
* Value Type: `String`
* Accepted Values: `'left'`, `'right'` (default)
Renders the [Chat SDK Badge](/agent-desk/integrations/web-sdk/web-customization#badge "Badge") and [iframe](/agent-desk/integrations/web-sdk/web-customization#iframe "iframe") on the left or right side of your page.
### AlwaysShowMinimize
* Key: `AlwaysShowMinimize`
* Value Type: `Boolean`
Determines if the iframe minimize icon displays in the Chat SDK's header. The default `false` value displays the button only on tablet and mobile screen sizes. When set to `true`, the button will also be visible on desktop-sized screens.
### BadgeColor
* Key: `BadgeColor`
* Value Type: `String`
* Accepted Values: `Color Keyword`,`RGB hex value`
Customizes the background color of the [Chat SDK Badge](/agent-desk/integrations/web-sdk/web-customization#badge "Badge").
This will be the primary color of Proactive Messages and Channel Picker if the PrimaryColor is not provided.
### BadgeText
* Key: `BadgeText`
* Value Type: `String`
Applies a caption to the [Chat SDK Badge](/agent-desk/integrations/web-sdk/web-customization#badge "Badge").
This setting only works when applying the `BadgeType`:`tray`.
### BadgeType
* Key: `BadgeType`
* Value Type: `String`
* Accepted Values: `'tray'`,`'badge'`(default) , `'none'`
`BadgeType: 'tray'`
`BadgeType: 'badge'`
Customizes the display of the [Chat SDK Badge](/agent-desk/integrations/web-sdk/web-customization#badge "Badge"). When you set the type to `'tray'`, you may also enter a `BadgeText` value. When you set this to 'none', the badge will not render.
### FrameDraggable
* Key: `FrameDraggable`
* Value Type: `Boolean`
Enabling this setting allows a user to reposition the placement of the [Chat SDK iframe](/agent-desk/integrations/web-sdk/web-customization#iframe "iframe").
When this is set to `true`, a user can hover over the frame's heading region, then click and drag to reposition the frame. The user's frame position will be recalled as they navigate your site or minimize/open the Chat SDK.
If the user has repositioned the frame, a button will appear allowing them to reset the Chat SDK to its default position.
### FrameStyle
* Key: `FrameStyle`
* Value Type: `String`
Accepted Values: `'sidebar'`, `'default'` (default)
Customizes the layout of the [Chat SDK iframe](/agent-desk/integrations/web-sdk/web-customization#iframe "iframe").
By default, the frame will appear as a floating window with a responsive height and width. When set to `'sidebar'`, the frame will be docked to the side of the page and take 100% of the browser's viewport height. The`'sidebar'` setting will adjust your page's content as though the user resized their browser viewport.
Use the `Align` setting if you wish to change which side of the page the frame appears on.
### HideBadgeOnLoad
* Key: `HideBadgeOnLoad`
* Value Type: `Boolean`
* Accepted Values: `'true'`,`'false'`(default)
When set to true, [Chat Badge](/agent-desk/integrations/web-sdk/web-customization#badge "Badge") is not visible on load. You can open the [Chat SDK iframe](/agent-desk/integrations/web-sdk/web-customization#iframe "iframe") via Proactive Message, [Chat Instead](../chat-instead/web "Web"), or [Show API](/agent-desk/integrations/web-sdk/web-javascript-api#show "'show'").
Once you open the Chat SDK iframe, Chat Badge will become visible allowing a user to minimize/reopen.
### Identity
* Key: `Identity`
* Value Type: `String`
A string that represents the branding you wish to display on the SDK. Your ASAPP Implementation Manager will help you determine this value.
If set to a non-supported value the Chat SDK will display in a generic, non-branded experience.
### PrimaryColor
* Key: `PrimaryColor`
* Value Type: `String`
* Accepted Values: `Color Keyword`,`RGB hex value`
Customizes the primary color of Proactive Messages and [Chat Instead](/agent-desk/integrations/chat-instead/web "Web").
This will be the background color of the [Chat SDK Badge](/agent-desk/integrations/web-sdk/web-customization#badge "Badge") if the BadgeColor is not provided.
## Intent
* Key: `Intent`
* Available APIs: [Load](/agent-desk/integrations/web-sdk/web-javascript-api#-load- "'load'")
* Value Type: `String`
The intent code that you wish for a user's conversation to initialize with. The setting takes an object, with a required key of `Code`. `Code` accepts a string.
Your team and your ASAPP Implementation Manager will determine the available values.
```javascript theme={null}
ASAPP('load', {
APIHostname: 'example-co-api.asapp.com',
AppId: 'example-co',
Intent: {
Code: 'PAYBILL'
}
});
```
## Language
* Key: `Language`
* Available APIs: [Load](/agent-desk/integrations/web-sdk/web-javascript-api#load "'load'")
* Value Type: `String`
By Default, the SDK will use English (`en`). You can override this by setting the `Language` property. It accepts a value of:
* `en` for English
* `fr` for French
* `es` for Spanish
ASAPP does not support switching languages mid-session, after a conversation has started. You must set a language before starting a conversation.
```javascript English theme={null}
ASAPP('load', {
APIHostname: 'example-co-api.asapp.com',
AppId: 'example-co',
Language: 'en'
});
```
```javascript French theme={null}
ASAPP('load', {
APIHostname: 'example-co-api.asapp.com',
AppId: 'example-co',
Language: 'fr'
});
```
## onLoadComplete
* Key: `onLoadComplete`
* Available APIs: [Load](/agent-desk/integrations/web-sdk/web-javascript-api#load "'load'")
* Value Type: `Function`
A callback that is triggered once the Chat SDK has finished initializing. This is useful when attaching events via the [Action API](/agent-desk/integrations/web-sdk/web-javascript-api#action-on-or-off "action: 'on' or 'off'") or whenever you need to perform custom actions to the SDK after it has loaded.
The provided method receives a single argument as a boolean value. If the value is `false`, then the page is not configured to display under the [ASAPP Trigger feature](/agent-desk/integrations/web-sdk/web-features#triggers "Triggers"). If the value is `true`, then the Chat SDK has loaded and finished appending to your DOM.
```
ASAPP('load', {
APIHostname: 'example-co-api.asapp.com',
AppId: 'example-co',
onLoadComplete: function (isDisplayingChat) {
console.log('ASAPP Loaded');
if (isDisplayingChat) {
ASAPP('on', 'message:received', handleMessageReceivedEvent);
} else {
console.log('ASAPP not enabled on this page');
}
}
});
```
## RegionCode
* Key: `RegionCode`
* Available APIs: [Load](/agent-desk/integrations/web-sdk/web-javascript-api#load "'load'")
* Value Type: `String`
Localizes the Chat SDK with a certain region. It accepts a value from the [ISO 3166 alpha-2 country codes](https://www.iso.org/obp/ui/#home) representing the country you wish to localize.
## Sound
* Key: `Sound`
* Available APIs: [Load](/agent-desk/integrations/web-sdk/web-javascript-api#load "'load'")
* Value Type: `Boolean`
When set to `true`, users will receive an audio notification when they receive a message in the chat log. This defaults to `false`.
## UserLoginHandler
* Key: `UserLoginHandler`
* Available APIs: [Load](/agent-desk/integrations/web-sdk/web-javascript-api#load "'load'")
* Value Type: `Function`
The `UserLoginHandler` allows you to provide a means of authentication so a user may access account information via the ASAPP Chat SDK. When the Chat SDK determines that a user is unauthorized, a "Log In" button appears. When the user clicks that button, the Chat SDK will call the method you provided. See the [Authentication](/agent-desk/integrations/web-sdk/web-authentication "Web Authentication") page for options on how you can authenticate your customers. Note: If you do not provide a `UserLoginHandler`, a user will not be able to transition from an anonymous to an authorized session.
When the Chat SDK calls the `UserLoginHandler`, it provides a single argument.
The argument is an object and contains various session information that may be useful to your integration. You and your Implementation Manager determine the information provided.
It may contain things such as [CompanySubdivision](/agent-desk/integrations/web-sdk/web-contextprovider#company-subdivisions "Company Subdivisions"), [ExternalSessioninformation](/agent-desk/integrations/web-sdk/web-contextprovider#session-information "Session Information"), and more.
```javascript theme={null}
ASAPP('load', {
APIHostname: 'example-co-api.asapp.com',
AppId: 'example-co',
UserLoginHandler: function (data) {
if (data.CompanySubdivision === 'chocolatiers') {
// Synchronous login
window.open('/login?makers=tempering')
} else {
// Get Customer Id and access_token ...
var CustomerId = 'Retrieved customer ID';
var access_token = 'Retrieved access token';
// Call SetCustomer with retrieved access_token, CustomerId, and ContextProvider
ASAPP('setCustomer', {
CustomerId: CustomerId,
ContextProvider: function (callback) {
var context = {
Auth: {
Token: access_token
}
};
callback(context);
}
});
}
}
});
```
# Web Authentication
Source: https://docs.asapp.com/agent-desk/integrations/web-sdk/web-authentication
This section details the process for authenticating your users to the ASAPP Chat SDK.
* [Authenticating at Page Load](#authenticating-at-page-load "Authenticating at Page Load")
* [Authenticating Asynchronously](#authenticating-asynchronously "Authenticating Asynchronously")
* [Using the 'UserLoginHandler' Method](#using-the-userloginhandler-method "Using the 'UserLoginHandler' Method")
Before getting started, make sure you've [embedded the ASAPP Chat SDK](/agent-desk/integrations/web-sdk/web-quick-start#1-embed-the-script "1. Embed the Script") into your site.
Your site is responsible for the entirety of the user authentication process. This includes the presentation of an interface for login and the maintenance of a session, and for the retrieval and formatting of context data about that user. Please read the section on using the [Authentication with the ContextProvider](/agent-desk/integrations/web-sdk/web-contextprovider#authentication "Authentication") to understand how you can pass authorization information to the Chat SDK.
Once your site has authenticated a user, you can securely pass that authentication forward to the ASAPP Chat environment by making certain calls to the ASAPP Chat SDK (more on those calls below). Your user can then be authenticated both on your web site and in the ASAPP Chat Environment, enabling them to execute within the ASAPP Chat use cases that require authentication.
ASAPP provides two methods for authenticating a user to the ASAPP Chat SDK.
* You can proactively [authenticate your user at page load](#authenticating-at-page-load "Authenticating at Page Load").
* You can [authenticate your user midway through a session](#authenticating-asynchronously "Authenticating Asynchronously") using the [SetCustomer API](/agent-desk/integrations/web-sdk/web-javascript-api#setcustomer "'setCustomer'").
With rare exceptions, you must also configure [UserLoginHandler](#using-the-userloginhandler-method "Using the 'UserLoginHandler' Method") to enable ASAPP to handle cases where a user requires authentication or re-authentication in the midst of a chat session (e.g., if a user's authentication credentials expire during a chat session.)
## Authenticating at Page Load
If a user who is already authenticated with your site requests a page that includes ASAPP chat functionality, you can proactively authenticate that user to the ASAPP SDK at page load time. This allows an authenticated user who initiates a chat session to have immediate access to their account details without having to login again.
To authenticate a user to the ASAPP Chat SDK on page load, use the ASAPP [Load API](/agent-desk/integrations/web-sdk/web-javascript-api#load "'load'") providing both [ContextProvider](/agent-desk/integrations/web-sdk/web-app-settings#contextprovider "ContextProvider") and [CustomerId](/agent-desk/integrations/web-sdk/web-app-settings#customerid "CustomerId") as additional keys in the [Load method](/agent-desk/integrations/web-sdk/web-javascript-api#load "'load'").
For example:
```javascript theme={null}
```
The sample above initializes the ASAPP Chat SDK with your user's `CustomerId` and a `ContextProvider` incorporating that user's `Auth`.
When a user opens the ASAPP Chat SDK, they are already authenticated to the chat client and can access account information within the chat without being asked to login again.
## Authenticating Asynchronously
If a user's authentication credentials are not available at page load time, you can authenticate asynchronously using the ASAPP [SetCustomer](/agent-desk/integrations/web-sdk/web-javascript-api#setcustomer "'setCustomer'") API.
After you've retrieved your user's credentials, you can call the API to authenticate that user with the ASAPP Chat SDK mid-session.
You might want to asynchronously authenticate a user to the ASAPP Chat SDK when (for example) that user has just completed a login flow, or if their credentials are retrieved after the page initially loads, or if a session expires and the user needs to reauthenticate.
The following sample snippet shows how to call the SetCustomer API:
```javascript theme={null}
```
Once you call the [SetCustomer](/agent-desk/integrations/web-sdk/web-javascript-api#setcustomer "'setCustomer'") method, and as long as the provided `Auth` information remains valid on your backend, any ASAPP Chat SDK actions that require authentication authenticate properly.
The SetCustomer method is typically called as part of the [UserLoginHandler](/agent-desk/integrations/web-sdk/web-app-settings#userloginhandler-11877 "UserLoginHandler").
See the section on [Using the 'UserLoginHandler' Method](#using-the-userloginhandler-method "Using the 'UserLoginHandler' Method") for a complete picture of how you may want to authenticate a user during an ASAPP Chat SDK session.
## Using the 'UserLoginHandler' Method
```javascript theme={null}
```
# Web ContextProvider
Source: https://docs.asapp.com/agent-desk/integrations/web-sdk/web-contextprovider
This section details the various ways you can use the ASAPP ContextProvider with the Chat SDK API. Before using the ContextProvider, make sure you've [integrated the ASAPP SDK](/agent-desk/integrations/web-sdk/web-quick-start "Web Quick Start") script on your page.
The ASAPP `ContextProvider` is used for passing various information about your users or their sessions to the Chat SDK. It is a key that may be set in the [Load and SetCustomer](/agent-desk/integrations/web-sdk/web-javascript-api) APIs. The key must be assigned a function that will receive two arguments.
The first argument is a `callback` function. The second argument is a `needsRefresh` boolean indicating whether or not the authorization information needs to be refreshed.
The `ContextProvider` is called whenever the user types in the Chat SDK.
## 'Callback'
After you've retrieved all the context needed for a user, call the `callback` argument with your context object as the sole argument. This will pass your context object to the ASAPP Chat SDK.
## 'needsRefresh'
The `needsRefresh` argument returns a boolean value indicating whether or not your user's authorization has expired.
```javascript theme={null}
function contextProviderHandler(callback, needsRefresh) {
var contextObject = Object.assign(
{},
yourGetAnalyticsMethod(),
yourGetSessionMethod(),
yourGetAuthenticationMethod()
);
if (needsRefresh) {
Object.assign(contextObject.Auth,
getUpdatedAuthorization()
);
}
callback(contextObject);
}
ASAPP('setCustomer', {
CustomerId: yourGetCustomerIdMethod(),
ContextProvider: contextProviderHandler
}
)
\
;
```
## Authentication
The `ContextProvider` plays an important role in authorizing your users with the ASAPP Chat SDK. Whether your users are always authenticated or transitioning from an anonymous to integrated use case, you must use the ContextProvider's `Auth` key to provide a user's authorization.
Your site is responsible for retrieving and providing all authorization information. Once provided to ASAPP, your user will be allowed secure access to any integrated use cases.
Along with providing a [CustomerId](/agent-desk/integrations/web-sdk/web-app-settings#customerid "CustomerId"), you'll need to provide any request body with information, cookies, headers, or access tokens required for ASAPP to authorize with your systems.
You may provide this information using the `Auth` key and the following set of nested properties:
```javascript theme={null}
function contextProviderHandler(callback, needsRefresh) {
var contextObject = {
// Auth key provided to the ContextProvider
Auth: {
Body: {
customParam: 'value'
},
Cookies: {
AuthCookie: 'authCookieValue'
},
Headers: {
'X-Custom-Header': 'value'
},
Scopes: ['paybill'],
Token: 'b34r3r...'
}
};
callback(contextObject);
}
```
Each key within the `Auth` object is optional, but you must provide any necessary information for your authenticated users.
* The `Body`, `Cookies`, and `Headers` keys all accept an object containing any number of key:value pairs.
* The `Scopes` key accepts an array of strings defining which services may be updated with the provided token.
* The `Token` key accepts a single access token string.
Please see the [Authentication](/agent-desk/integrations/web-sdk/web-authentication "Web Authentication") section for full details on using the `ContextProvider` for authenticating your users.
## Customer Info
You may assign analytic data and add other customer information to a user's Chat SDK interactions by using the `CustomerInfo` key. The key is a child of the context object and contains a series of key:value pairs.
Your page is responsible for defining and setting the keys you would like to track. You may define and pass along as many keys as you would like.
You must discuss and agree upon the attribute names with your Implementation Manager.
**CustomerInfo:**
* Key: `CustomerInfo`
* Value Type: `Object`
The object should contain a set of key:value pairs that you wish to provide as analytics or customer information. The value of each key must be a string.
**WARNING ABOUT SENSITIVE DATA**
Do NOT send sensitive data via `CustomerInfo`, `custom_params`, or `customer_params`. For more information, [click here](/security/warning-about-customerinfo-and-sensitive-data "Warning about CustomerInfo and Sensitive Data").
A user does not need to be authenticated in order to provide analytics information. The following code snippet shows the `CustomerInfo` key being used to pass along analytics data.
```javascript theme={null}
function contextProviderHandler(callback, needsRefresh) {
var contextObject = {
CustomerInfo: {
// Your own key: value pairs
category: 'payment',
action: 'ASAPP',
parent_page: 'Pay my Bill'
}
};
// Return the callback
callback(contextObject);
}
ASAPP('load', {
APIHostname: '[API_HOSTNAME]',
AppId: '[APP_ID]',
ContextProvider: contextProviderHandler
});
```
## Session Information
The `ContextProvider` may be used for passing existing session information along to the Chat SDK. This is for connecting a user's page session with their SDK session.
You may provide two keys---`ExternalSessionId `and `ExternalSessionType`---for connecting session information. The value of each key is at your discretion.
A user does not need to be authenticated in order to provide session information.
### ExternalSessionId
* Key: `ExternalSessionId`
* Value Type: `String`
* Example Value: `'j6oAOxCWZh...'`
Your user's unique session identifier. This information can be used for joining your session IDs with ASAPP's session IDs.
### ExternalSessionType
* Key: `ExternalSessionType`
* Value Type: `String`
* Example Value:`'visitID'`
A descriptive label of the type of identifier being passed via the `ExternalSessionId`.
## Company Subdivisions
If your company has multiple entities segmented under a single AppId, you may use the `ContextProvider` to pass the entity information along to the Chat SDK.
To do so, provide the optional `CompanySubdivision`key with a value of your subdivision's identifier. The identifier value will be determined in coordination with your ASAPP Implementation Manager.
### CompanySubdivision
* Key: `CompanySubdivision`
* Value Type: `Object`
* Example Value: `'divisionId'`
An object containing a set of key:value pairs that you wish to provide as analytics information. The value of each key must be a string.
## Segments
If your company needs to group users at a more granular level than [AppId](/agent-desk/integrations/web-sdk/web-app-settings#appid "AppId") or [CompanySubdivision](#company-subdivisions "Company Subdivisions"), you may use the `Segments` key to apply labels to your reports.
Each key you provide allows you to filter your reporting dashboard by those values.
### Segments
* Key: `Segments`
* Value Type: `Array`
* Example Value: \[`'north america'`, `'usa',``'northeast'`]
The key value must be an array containing a set of strings.
# Web Customization
Source: https://docs.asapp.com/agent-desk/integrations/web-sdk/web-customization
Once properly installed and configured, the ASAPP Chat SDK embeds two snippets of HTML markup into your host web page:
* [Chat SDK Badge](#badge "Badge")
* [Chat SDK iframe](#iframe "iframe")
This section details how these elements function. In addition, it describes how to [Customize the Chat UI](#customize-the-chat-ui "Customize the Chat UI"), [Dynamic Styling Configuration](#dynamic-styling-configuration), [Custom Icons](#custom-icons), and [Advanced Configuration Options](#advanced-configuration-options).
## Badge
The ASAPP Chat SDK Badge is the default interface element your customers can use to open or close the ASAPP Chat iframe.
When a user clicks on this element, it will trigger the [ASAPP('Show')](/agent-desk/integrations/web-sdk/web-javascript-api#show "'show'") or [ASAPP('Hide')](/agent-desk/integrations/web-sdk/web-javascript-api#hide"'hide'") APIs.
This toggles the display of the ASAPP Chat SDK iframe.
### Badge Markup
By default. the ASAPP Chat SDK Badge is inserted into your markup as a lightweight `button` element, with a click behavior that toggles the display of the [iframe](#iframe "iframe") element. ASAPP recommends that you use the default badge element so you can take advantage of our latest features as they become available.
However, if you wish to customize the badge, you can do so by either manipulating the CSS associated with the badge, or by hiding/removing the element from your DOM and toggling the display of the iframe using your own custom element. See the [Badge Styling](#asapp-badge-styling "ASAPP Badge Styling") section below for more details on customizing the appearance of the ASAPP Chat SDK Badge.
```html theme={null}
```
### ASAPP Badge Styling
You can customize the ASAPP Chat SDK Badge with CSS using the ID `#asapp-chat-sdk-badge` or classname `.asappChatSDKBadge` selectors. ASAPP recommends that you use [BadgeColor](/agent-desk/integrations/web-sdk/web-app-settings#display "Display").
The following snippet is an example of how you might use these selectors to customize the element to meet your brand needs:
```css theme={null}
#asapp-chat-sdk-badge {
background-color: rebeccapurple;
}
#asapp-chat-sdk-badge:focus,
#asapp-chat-sdk-badge:hover,
#asapp-chat-sdk-badge:active {
-webkit-tap-highlight-color: rgba(102, 51, 153, 0.25);
background-color: #fff;
}
#asapp-chat-sdk-badge .icon {
fill: #fff;
}
#asapp-chat-sdk-badge:focus .icon,
#asapp-chat-sdk-badge:hover .icon,
#asapp-chat-sdk-badge:active .icon {
fill: rebeccapurple;
}
```
### Custom Badge
You can hide the ASAPP Chat SDK Badge and provide your own interface for opening the ASAPP Chat SDK iframe.
* Set [BadgeType](/agent-desk/integrations/web-sdk/web-app-settings#display "Display") to none.
* Call [`ASAPP('show')`](/agent-desk/integrations/web-sdk/web-javascript-api#show "'show'") and/or [`ASAPP('hide')`](/agent-desk/integrations/web-sdk/web-javascript-api#hide "'hide'") when your custom badge is clicked to open/close the iframe.
* In order to ensure that the Chat SDK is ready, ASAPP recommends to display your custom badge disabled/loading state at first and then utilize [onLoadComplete](/agent-desk/integrations/web-sdk/web-app-settings#onloadcomplete "onLoadComplete") to enable it.
**Example:**
In the code example below, the 'Chat with us' button is not clickable until you enable it using onLoadComplete.
Once enabled, a user can click the button to open the ASAPP SDK iframe.
Custom Button:
```html theme={null}
```
Load config example:
```javascript theme={null}
```
## iframe
The ASAPP Chat SDK iframe contains the interface that your customers will use to interact with the ASAPP platform.
The element is populated with ASAPP-provided functionality and styled elements, but the iframe itself is customizable to your brand's needs.
### iframe Markup
The SDK iframe is instantiated as a lightweight `