### Example Certificate for SSO Configuration
Source: https://docs.ada.cx/generative/docs/other/team-access/sso
This is an example of an Identity Provider (IDP) certificate in PEM format. This certificate is required to complete the SSO setup process with Ada. You may need to save a string resembling this into a .pem file.
```text
-----BEGIN CERTIFICATE-----
MIIDVjCCAj4CCQD7DEtIu02MpzANBgkqhkiG9w0BAQsFADBtMQswCQYDVQQGEwJV
UzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEQ
blahblahblahyougettheidea1aYLG4r1w7QcnH8TYQb0ZqOTfTrl8HE+rD457zp
1QBTbbNWfiLLB0hAqkZuNormxaYRDb8rlAzDlargoVy/O4bxSiuoVrVTMxEkYYZ/
Ji3edZ7TXGbvp6TR9as+B8V2caeJ9TLmmtG1gg8mrsZSin+/ZtLZN8H3
-----END CERTIFICATE-----
```
--------------------------------
### Backend Action to Get Region and ETA (Node.js)
Source: https://docs.ada.cx/generative/docs/optimization/personalization/best-practices
Example of a backend action that determines a user's region and estimated time of arrival (ETA) range based on their country. This data can then be used to dynamically tailor the AI Agent's responses.
```javascript
function getRegionAndETA(countryCode) {
let region, eta_range;
if (['US', 'CA'].includes(countryCode)) {
region = 'A';
eta_range = '3–5 business days';
} else if (['UK', 'EU'].includes(countryCode)) {
region = 'B';
eta_range = '4–7 business days';
} else {
region = 'C';
eta_range = '7–14 business days';
}
return { region, eta_range };
}
// Example usage:
// const userCountry = 'US';
// const shippingInfo = getRegionAndETA(userCountry);
// console.log(shippingInfo); // { region: 'A', eta_range: '3–5 business days' }
```
--------------------------------
### Extracting Specific Data from Star Wars API Example
Source: https://docs.ada.cx/generative/docs/channels/social/social-channel-onboarding
Provides concrete examples of using data keys to extract information about species from the Star Wars API. It shows how to target the name, the films array, and a specific film within the films array for the first species listed.
```json
{
...
"results": [
{
"name": "Human",
"classification": "mammal",
"designation": "sentient",
...
"films": [
"https://swapi.dev/api/films/1/",
"https://swapi.dev/api/films/2/",
"https://swapi.dev/api/films/3/",
"https://swapi.dev/api/films/4/",
"https://swapi.dev/api/films/5/",
"https://swapi.dev/api/films/6/"
],
...
},
...
]
}
```
```json
// Target the name of the first species
results[0].name
// Target the array of films for the first species
results[0].films
// Target the fourth film (index 3) in the films array for the first species
results[0].films[3]
```
--------------------------------
### Example Sunshine Conversations Web Integration Response
Source: https://docs.ada.cx/generative/docs/channels/third-party/sunshine-web-messenger
This is an example of the response received after successfully creating a web integration. It includes the unique 'id' of the integration, which can be used for further operations, along with its status and configuration details.
```json
{
"integration": {
"id": "645032477d43a37749e94ef6",
"status": "active",
"type": "web",
"displayName": "Channel Name",
"brandColor": "65758e",
"conversationColor": "0099ff",
"actionColor": "0099ff",
"displayStyle": "button",
"canUserCreateMoreConversations": false,
"canUserSeeConversationList": false
}
}
```
--------------------------------
### API Connection and Configuration
Source: https://docs.ada.cx/generative/docs/automation/actions/action-control
This section covers the core steps for connecting to an API, including URL construction, method selection, and header and body configuration.
```APIDOC
## Connecting to an API
This API integration process allows your bot to interact with external services.
### Key Steps:
1. **Define Inputs**: Specify the data your API call will need. Ensure names are URL-friendly (e.g., `email`, `order_id`).
2. **Connect to API**: Configure the API call details.
* **Endpoint Tab**:
* **URL**: Enter the API endpoint URL. Use `@` to insert available tokens, inputs, or metavariables as placeholders.
* **Method**: Select the HTTP method (GET, POST, PATCH, PUT, DELETE).
* **Headers Tab** (If required):
* Click **Add headers** and provide **Parameter** and **Value** for each header.
* **Body Tab** (For POST, PATCH, PUT requests):
* Enter the request payload.
* **This API uses**: Select the data format for input and output (JSON or XML).
3. **Test API Response**: Verify the API connection and response.
* Click **Test** for calls without custom inputs.
* Click **Set test values**, enter values for custom inputs, then click **Save and test**.
4. **Use API Outputs in Chat (Optional)**:
* **Output**: Name the output for the bot to use.
* **Path**: Specify the JMESPath to capture the desired portion of the API response.
```
--------------------------------
### API Response Management
Source: https://docs.ada.cx/generative/docs/channels/social/social-channel-onboarding
Learn how to interact with API responses, including repeating requests, copying response bodies, and handling errors.
```APIDOC
## API Response Management
### Description
Provides options for interacting with the results of an API call.
### Features
* **Repeat Request**: Re-execute the last API request.
* **Copy Response**: Copy the entire response body to the clipboard.
* **Error Fallback**: Define actions to take if an API call fails.
* **Save As Variable**: Store parts or all of the API response in variables for later use.
### Icons
* **Repeat**:
* **Copy**:
```
--------------------------------
### Target Specific Item within Nested Arrays using Index
Source: https://docs.ada.cx/generative/docs/automation/greetings/greeting-management
Access specific elements within nested arrays by specifying their index. This example targets the first item (index 0) of the 'parent' array, then the second item (index 1) of the 'child' array within it. Array indexing starts at 0.
```javascript
{
"data_key": "parent[0].child[1]"
}
```
--------------------------------
### Set AI Agent Starting Language with Embed2 Script
Source: https://docs.ada.cx/generative/docs/setup/languages/multilingual-support-setup
Modify the Ada Embed2 script to set a specific default language for your AI Agent's web chats. This involves adding a `window.adaSettings` object with the desired language code before the main Ada Embed2 script. Ensure the language code follows the ISO 639-1 standard.
```html
```
--------------------------------
### Initialize AI Agent with Appearance Customizations (JavaScript)
Source: https://docs.ada.cx/generative/docs/channels/third-party/sunshine-web-messenger
Initializes the Smooch Web Messenger with AI Agent appearance customizations. This includes setting the business name, icon URL, and brand colors. Ensure integrationId is provided. Dependencies include the Smooch library. Outputs are the configured chat window appearance.
```javascript
Smooch.init({
// Default bot settings
integrationId: 'ADD-INTEGRATION-ID-HERE',
integrationOrder: [],
notificationChannelPromptEnabled: false,
canUserSeeConversationList: false,
// Bot customizations
businessName: 'My AI Agent',
businessIconUrl: 'https://media.smooch.io/5f19b4c836ced4000c3a7dc3/icons/8f539f6284ca2f79cda7b0bda0b98cc3.jpg',
customColors: {
brandColor: '944dff', // Purple
conversationColor: '4ddbff', // Cyan
actionColor: 'ff4da6', // Hot pink
},
}).then( function() {
// Your code after init is complete
}, function(err) {
// Something went wrong during initialization
}
);
```
--------------------------------
### Configure Zendesk App with Ada Details
Source: https://docs.ada.cx/generative/docs/handoffs/zendesk/zendesk-support
This section outlines the configuration steps for the Zendesk app within Zendesk, requiring Ada-specific details such as subdomain and cluster, and an Ada Configuration Token.
```text
ada_subdomain: Type your Ada's bot handle.
ada_cluster: Specify your Ada cluster. A cluster represents a specific environment used for different stages of agent deployment. In your AI Agent, the cluster is identified by the segment of the URL that follows the bot handle. For example, in the URL `https://{ada_subdomain}.ada.support`, `ada.support` represents the cluster.
Client Token: Paste the Ada Configuration Token from Ada.
```