# CRM

# CRM Integrations Study Guide

---

# What is CRM?

CRM stands for:

# Customer Relationship Management

A CRM stores customer information and interaction history.

Common CRMs:

* Salesforce
* Zendesk
* ServiceNow
* HubSpot
* Microsoft Dynamics

---

# Why CRM Integrations Matter

CRM integrations allow platforms like Glia to share customer data with business systems.

Example:

```text
Glia ↔ CRM ↔ Banking System
```

This helps agents see:

* customer profile
* account details
* previous interactions
* open tickets
* case history

---

# Common CRM Integration Use Cases

| Use Case               | Description                                   |
| ---------------------- | --------------------------------------------- |
| Customer lookup        | Find customer details when interaction starts |
| Screen pop             | Automatically open customer record for agent  |
| Ticket creation        | Create case after chat/call                   |
| Interaction logging    | Save chat/call history in CRM                 |
| Status updates         | Update ticket or customer journey status      |
| Routing logic          | Route customer based on CRM data              |
| Authentication context | Use logged-in user info to identify customer  |

---

# Basic CRM Integration Flow

```text
Customer starts chat
      ↓
Glia receives customer ID
      ↓
Glia calls CRM API
      ↓
CRM returns customer data
      ↓
Agent sees customer profile
```

---

# Example CRM API Request

```http
GET /api/customers/12345
Authorization: Bearer token
Content-Type: application/json
```

Purpose:

Retrieve customer profile from CRM.

---

# Example CRM API Response

```json
{
  "customerId": "12345",
  "name": "Cesar Gonzalez",
  "status": "premium",
  "openCases": 2
}
```

---

# Common Integration Patterns

| Pattern         | Description                                |
| --------------- | ------------------------------------------ |
| API integration | Systems exchange data using REST APIs      |
| Webhooks        | CRM receives event notifications           |
| Embedded widget | Glia embedded inside CRM                   |
| Screen pop      | Customer record opens automatically        |
| Data sync       | Customer data synchronized between systems |
| SSO             | Users authenticate once across systems     |

---

# CRM Integration With Webhooks

Example:

```text
Chat completed
      ↓
Webhook sent to CRM
      ↓
CRM creates case summary
```

Webhook payload:

```json
{
  "event": "chat_completed",
  "customerId": "12345",
  "agent": "agent01",
  "summary": "Customer asked about loan status"
}
```

---

# CRM Integration With Screen Pop

Screen pop means:

# automatically opening the customer record for the agent

Example:

```text
Incoming interaction → CRM opens customer profile
```

This improves:

* agent speed
* personalization
* customer experience

---

# CRM Integration With Routing

CRM data can influence routing.

Example:

```text
Customer status = VIP
      ↓
Route to priority queue
```

Other routing examples:

* language
* account type
* product
* region
* open case severity

---

# Common CRM Integration Problems

| Problem                | Likely Cause                                |
| ---------------------- | ------------------------------------------- |
| Customer not found     | Wrong customer ID or CRM record missing     |
| Screen pop not working | Bad URL mapping or missing customer field   |
| Ticket not created     | API failure, bad payload, permissions issue |
| Data not syncing       | Webhook failure or field mapping issue      |
| 401 Unauthorized       | Invalid or expired token                    |
| 403 Forbidden          | Missing CRM permissions                     |
| 400 Bad Request        | Invalid JSON or missing required fields     |
| Slow response          | CRM latency or network issue                |

---

# CRM Integration Troubleshooting Flow

# Step 1 — Understand the Expected Flow

Ask:

```text
What should happen?
What actually happened?
Where does the flow fail?
```

Example:

```text
Expected: Chat ends → CRM ticket created
Actual: Chat ends → No ticket appears
```

---

# Step 2 — Identify the Integration Type

Check whether the issue involves:

* REST API
* webhook
* SSO
* screen pop
* embedded widget
* data sync

---

# Step 3 — Check Authentication

Validate:

* OAuth token
* bearer token
* API key
* permissions
* scopes

Common errors:

* 401 = authentication problem
* 403 = permission problem

---

# Step 4 — Validate API Request

Check:

* endpoint URL
* HTTP method
* headers
* JSON payload
* required fields

Example:

```http
POST /api/cases
Authorization: Bearer token
Content-Type: application/json
```

---

# Step 5 — Validate Field Mapping

Field mapping means matching data between systems.

Example:

| Glia Field    | CRM Field      |
| ------------- | -------------- |
| customerId    | Contact ID     |
| email         | Email          |
| interactionId | Case Reference |
| agentName     | Owner          |
| transcript    | Case Notes     |

Common issue:

```text
Glia sends customerId, but CRM expects contactId
```

---

# Step 6 — Review Logs

Check:

* API logs
* webhook delivery logs
* CRM logs
* timestamps
* request IDs
* correlation IDs

---

# Step 7 — Validate Network

Check:

* DNS
* firewall
* proxy
* HTTPS/TLS
* allowlists
* rate limits

---

# Step 8 — Test With Known Good Data

Use a test customer record.

Example:

```text
Customer ID 12345 exists in CRM
```

Then validate:

* lookup works
* screen pop works
* ticket creation works

---

# Step 9 — Escalate With Evidence

Before escalating, collect:

* timestamps
* request/response examples
* HTTP response codes
* screenshots
* affected users
* correlation IDs

---

# Common Troubleshooting Scenarios

## Scenario 1 — CRM Customer Lookup Fails

Possible causes:

* wrong customer ID
* missing record
* incorrect endpoint
* expired token

Troubleshooting:

* verify customer exists in CRM
* test API call manually
* check 401/403/404 errors
* validate field mapping

---

## Scenario 2 — Ticket Creation Fails

Possible causes:

* missing required fields
* invalid JSON
* insufficient permissions
* CRM API outage

Troubleshooting:

* validate JSON payload
* check required fields
* review API response
* confirm CRM service status

---

## Scenario 3 — Screen Pop Not Opening

Possible causes:

* browser pop-up blocked
* bad URL template
* missing customer identifier
* CRM permissions issue

Troubleshooting:

* validate URL format
* confirm customer ID is passed
* test manually in browser
* check agent permissions

---

## Scenario 4 — Webhook Not Updating CRM

Possible causes:

* webhook URL incorrect
* endpoint unavailable
* authentication failure
* TLS certificate issue

Troubleshooting:

* validate webhook delivery logs
* check endpoint availability
* verify HTTPS/TLS
* inspect response codes

---

## Scenario 5 — Slow CRM Response

Possible causes:

* CRM latency
* network delay
* rate limiting
* overloaded integration middleware

Troubleshooting:

* check API response time
* review rate limits
* validate middleware health
* compare with other requests

---

# Good Interview Answer

## “How would you troubleshoot a CRM integration issue?”

> “I would first confirm the expected workflow and identify where the failure occurs, whether it is API, webhook, SSO, screen pop, or data sync related. Then I would validate authentication, request payloads, field mapping, response codes, logs, network connectivity, and test with known good records before escalating with clear evidence.”

---

# Key Terms To Know

| Term            | Meaning                                 |
| --------------- | --------------------------------------- |
| CRM             | Customer relationship management system |
| Screen pop      | Auto-open customer record               |
| Field mapping   | Matching fields between systems         |
| API integration | Systems exchanging data through APIs    |
| Webhook         | Event notification to another system    |
| SSO             | Single sign-on                          |
| Data sync       | Keeping systems updated                 |
| Correlation ID  | Tracking ID for troubleshooting         |
| Rate limit      | Maximum allowed API calls               |
| Middleware      | System between two applications         |

---

# Easy Memory Trick

# CRM integration = customer context + automation

It helps agents know:

```text
Who is the customer?
What happened before?
What should happen next?
```