Skip to main content

Documentation

Call Center System Manual

Please see  – How to add device (Phone Number Twilio). – Video Link Verified – Open in a new tab.

 

Full Set Uphttps://youtu.be/8DRhCwu9pEo

Optional for “API Request” Ignore.

## 1. Initial Setup Requirements

### 1.1 Twilio Setup
1. Account Requirements:
– Twilio Account SID
– Auth Token
– Phone Number
– API Key/Secret

2. Base64 Encode Your Credentials:
– Go to: https://www.base64encode.org/
– Enter: AccountSID:AuthToken
– Save the encoded string for API configurations

### 1.2 WooCommerce Bookings Setup
1. Required Information:
– Product ID for your service
– Consumer Key
– Consumer Secret
2. Base64 encode your WooCommerce credentials:
– Format: consumer_key:consumer_secret
– Save for API configurations

## 2. Call Flow Configuration

### 2.1 Main Menu Setup
Gather Node Configuration:
“`
Language: English (US)
Voice: Salli
Text: “Welcome to our appointment system.
Press 1 for new appointments
Press 2 to check existing appointments
Press 3 to leave a message”
“`

### 2.2 OpenAI Assistant Configuration
“`
Language: English (US)
Voice: Karen-Neural
Opening message: “Hello, I’m your AI assistant. How can I help you today?”

AI Training: “You are a booking assistant. Help customers book appointments.
Collect their name and preferred appointment time.
Appointments are 30 minutes long.
Business hours are 9 AM to 5 PM, Monday to Friday.
After collecting information, confirm details with the customer.”

Model: gpt-3.5-turbo
Messages history: 3
Words per sec: 3
“`

## 3. API Integration Setup

### 3.1 WooCommerce Booking Endpoints

#### Check Availability (GET)
Configure Make API Request node:
“`
URL: https://[your-domain]/wp-json/wc-bookings/v1/products/slots
Headers:
– Authorization: Basic [your_encoded_credentials]
– Content-Type: application/json

Parameters to check after getting date from customer:
product_ids=[your_product_id]
min_date={{appointment_date}}
max_date={{appointment_date}}
“`

#### Create Booking (POST)
“`
URL: https://[your-domain]/wp-json/wc-bookings/v1/bookings
Headers: [Same as above]

Body:
{
“product_id”: “[your_product_id]”,
“start_date”: “{{appointment_date}}T{{start_time}}”,
“end_date”: “{{appointment_date}}T{{end_time}}”,
“customer_id”: “{{recipient_number}}”,
“customer_name”: “{{captured_name}}”,
“status”: “confirmed”
}
“`

### 3.2 Call Flow Variables
Important variables to use:
“`
{{recipient_number}} – Customer’s phone number
{{captured_name}} – Customer’s name from voice input
{{appointment_date}} – Selected date
{{start_time}} – Appointment start time
{{end_time}} – End time (30 mins after start)
“`

## 4. Voice Flow Setup

### 4.1 New Appointment Flow
1. Customer Information Collection:
“`
Say Node: “Please say your name after the beep”
Capture Data Node: Store as {{captured_name}}

Say Node: “When would you like your appointment?”
Capture Data Node: Store as {{appointment_date}}

Say Node: “What time would you prefer? Our appointments are 30 minutes long”
Capture Data Node: Store as {{start_time}}
“`

2. Confirmation Flow:
“`
Say Node: “I’ll book your appointment for {{captured_name}} on {{appointment_date}}
at {{start_time}}. Press 1 to confirm, 2 to restart.”
“`

### 4.2 Check Existing Appointments
“`
Say Node: “I’ll look up your appointments using your phone number {{recipient_number}}”
Make API Request: GET /bookings?customer_phone={{recipient_number}}
Say Node: “I found your appointment for {{booking_date}} at {{booking_time}}”
“`

## 5. System Customization

### 5.1 Voice Customization
Available voices:
– Salli: Main menu and system messages
– Karen-Neural: AI assistant
– Joanna-Neural: Confirmations

### 5.2 Business Hours
Default settings:
– Monday to Friday
– 9 AM to 5 PM
– 30-minute appointments

To modify:
1. Update OpenAI training prompt
2. Adjust availability check parameters
3. Modify booking slot duration

## 6. Monitoring and Maintenance

### 6.1 API Health Checks
Regularly verify:
1. WooCommerce API connection
2. Twilio API status
3. OpenAI API access

### 6.2 System Logs
Monitor:
– Failed bookings
– Missed calls
– API errors
– Voice recognition issues

## 7. Troubleshooting

### 7.1 Common Issues
1. API Connection Errors:
– Verify credentials
– Check base64 encoding
– Confirm API endpoints

2. Voice Recognition Issues:
– Check microphone settings
– Verify language settings
– Test different voice models

3. Booking Failures:
– Verify product ID
– Check date format
– Confirm availability

Example – Please don’t use any info/API from this example. Add your own!

# API Endpoints Configuration Guide

## 1. Base Configuration
Base URL: `https://my.cjmagix.com/wp-json/wc-bookings/v1/`
Headers for all requests:
“`
Authorization: Basic Y2tfYTIyZTVmNzc2ZTE2OGY2OTQ0ODhiNTMzNDNiZWRjMmRjNjllMDIyZjpjc184ZDY5NGI2MjEwMWMzNjViNzFmYjg4OGZkZmJhMTM3YjAyZTdiYTEy
Content-Type: application/json
“`

## 2. API Endpoints

### 2.1 Check Available Slots (GET)
“`
URL: https://my.cjmagix.com/wp-json/wc-bookings/v1/products/slots
Parameters:
product_ids=126
min_date={{captured_date}}
max_date={{captured_date}}
“`
Example response:
“`json
{
“records”: [
{
“date”: “2024-12-20T09:00:00”,
“duration”: 30,
“available”: true,
“booked”: false
}
]
}
“`

### 2.2 Create New Booking (POST)
“`
URL: https://my.cjmagix.com/wp-json/wc-bookings/v1/bookings

Body:
{
“product_id”: 126,
“start_date”: “{{captured_date}}T{{start_time}}”,
“end_date”: “{{captured_date}}T{{end_time}}”,
“customer_id”: “{{recipient_number}}”,
“customer_name”: “{{captured_name}}”,
“status”: “confirmed”
}
“`

### 2.3 Check Existing Bookings (GET)
“`
URL: https://my.cjmagix.com/wp-json/wc-bookings/v1/bookings
Parameters:
customer_phone={{recipient_number}}
“`

### 2.4 Modify Booking (PUT)
“`
URL: https://my.cjmagix.com/wp-json/wc-bookings/v1/bookings/{{booking_id}}

Body:
{
“start_date”: “{{new_date}}T{{new_time}}”,
“end_date”: “{{new_date}}T{{new_end_time}}”,
“status”: “confirmed”
}
“`

### 2.5 Cancel Booking (DELETE)
“`
URL: https://my.cjmagix.com/wp-json/wc-bookings/v1/bookings/{{booking_id}}
“`

## 3. Implementation in Flow Modules

### 3.1 Make API Request Node Configuration

#### For Checking Availability:
“`
Method: GET
URL: https://my.cjmagix.com/wp-json/wc-bookings/v1/products/slots?product_ids=126&min_date={{captured_date}}&max_date={{captured_date}}

Headers:
– Authorization: Basic Y2tfYTIyZTVmNzc2ZTE2OGY2OTQ0ODhiNTMzNDNiZWRjMmRjNjllMDIyZjpjc184ZDY5NGI2MjEwMWMzNjViNzFmYjg4OGZkZmJhMTM3YjAyZTdiYTEy
– Content-Type: application/json
“`

#### For Creating Booking:
“`
Method: POST
URL: https://my.cjmagix.com/wp-json/wc-bookings/v1/bookings

Headers: [Same as above]

Body:
To be added one by one:
– product_id: 126
– start_date: {{captured_date}}T{{start_time}}
– end_date: {{captured_date}}T{{end_time}}
– customer_id: {{recipient_number}}
– customer_name: {{captured_name}}
– status: confirmed
“`

## 4. Variable Handling

### 4.1 Date/Time Variables
“`
{{captured_date}}: Format YYYY-MM-DD
{{start_time}}: Format HH:mm:00
{{end_time}}: 30 minutes after start_time
{{booking_id}}: Returned from create/get booking responses
“`

### 4.2 Customer Variables
“`
{{recipient_number}}: Automatically captured from caller
{{captured_name}}: From voice input
“`

## 5. Response Handling

### 5.1 Successful Responses
Available Slots:
“`json
{
“records”: [
{
“date”: “2024-12-20T09:00:00”,
“available”: true
}
]
}
“`

New Booking:
“`json
{
“id”: “booking_id”,
“start_date”: “2024-12-20T09:00:00”,
“status”: “confirmed”
}
“`

### 5.2 Error Response Examples
“`json
{
“code”: “rest_no_route”,
“message”: “No route was found matching the URL and request method”
}
“`

Twilio Set Up for Live Agent if Needed

Example  – Please don’t use any content from here

# Twilio Live Agent Implementation Guide

## 1. Base Configuration
Account Details:
“`
Account SID: AC10ad32d75c48f85c9626…..
Auth Token: 41d12d84516e4aec155b…….
Phone Number: +1502….
API Key: SKdb65fa8df4665d….
API Secret: NGibxpnm5MB…..
“`

Base64 Encoded Credentials:
“`
Original: AC10ad32d75c48f85c96264b9d4bf77ce5:41d12d84516e4ae…..
Encoded: QUMxMGFkMzJkNzVjNDhmODVjOTYyNjRiOWQ0YmY3N2NlNTo0MWQxMmQ4NDUxNmU0YWVjMTU1Yj….
“`

## 2. Flow Module Configuration

### 2.1 Main Menu Gather Node
“`
Language: English (US)
Voice: Salli
Text: “Welcome to our service.
For appointments, press 1
To check bookings, press 2
To leave a message, press 3
To speak with an agent, press 4″
“`

### 2.2 Live Agent Transfer Setup

Make API Request Node:
“`
Method: POST
URL: https://api.twilio.com/2010-04-01/Accounts/AC10ad32d75c48f85c96264b9d4bf77ce5/Calls.json

Headers:
Authorization: Basic QUMxMGFkMzJkNzVjNDhmODVjOTYyNjRiOWQ0YmY3N2NlNTo0MWQxMmQ4NDUxNmU0YWVjMTU1YjJhZ……
Content-Type: application/json

Body:
To: +15029161836 – Enter Your Phone Number here
From: {{recipient_number}}
Twiml: <Response><Say>Connecting to an agent</Say><Dial>+15029161836</Dial></Response>
“`

### 2.3 Pre-Transfer Announcement
“`
Language: English (US)
Voice: Salli
Text: “Please hold while we connect you to an agent.”
“`

## 3. Implementation Flow

### 3.1 Customer Presses 4 for Live Agent

1. Say Node:
“`
Language: English (US)
Voice: Salli
Text: “Connecting you to our next available agent. Please hold.”
“`

2. Make API Request Node Configuration:
“`
Method: POST
URL: https://api.twilio.com/2010-04-01/Accounts/AC10ad32d75c48f85c96264b9d4bf77ce5/Calls.json

Headers:
– Authorization: Basic [your_encoded_credentials]
– Content-Type: application/json

Body Parameters:
– To: +15029161836
– From: {{recipient_number}}
– Twiml: <Response><Say>Connecting to an agent</Say><Dial>+15029161836</Dial></Response>
“`

### 3.2 Variable Handling
“`
{{recipient_number}}: Caller’s phone number (automatically captured)
{{agent_number}}: +15029161836 (your agent number)
{{call_sid}}: Current call identifier
“`

## 4. Agent Availability Handling

### 4.1 Business Hours Check
Condition Node:
“`
If response equal to: 4
If time within 9 AM – 5 PM:
→ Connect to agent
If outside business hours:
→ Play message: “Our agents are available Monday through Friday, 9 AM to 5 PM.”
“`

### 4.2 Voicemail Fallback
If agent unavailable:
“`
Say Node: “Our agents are currently assisting other customers.
Please leave a message after the tone.”
Capture Data Node: Record message
Send SMS Node: Notify agent of missed call
“`

## 5. Transfer Flow

### 5.1 Successful Transfer:
“`
1. Customer selects option 4
2. System plays holding message
3. API request initiates transfer
4. Agent phone rings
5. Call connected
“`

### 5.2 Failed Transfer:
“`
1. System detects transfer failure
2. Play message: “We’re unable to connect you at this time”
3. Offer voicemail option
4. Send SMS to agent with caller details
“`

## 6. Agent Notifications

### 6.1 SMS Alert Configuration
Send SMS Node:
“`
Device: Device 1
Message: “New call from {{recipient_number}} requires attention.”
“`

### 6.2 Missed Call Notification
“`
Device: Device 1
Message: “Missed call from {{recipient_number}} at {{timestamp}}.
Voicemail recorded: {{voicemail_url}}”
“`

More Info

# Complete Call Center Integration Documentation

## 1. Initial Call Flow

### 1.1 On-call Node
“`
{{recipient_number}}
{{my_number}}
“`

### 1.2 Main Menu (Gather)
Language: English (US)
Voice: Salli
Text: “Welcome to our appointment system.
Press 1 for new appointments
Press 2 to check existing appointments
Press 3 to leave a message”

## 2. New Appointment Flow (Option 1)

### 2.1 Customer Information Collection
Say Node:
“`
Language: English (US)
Voice: Salli
Text: “Please say your name after the beep”
“`

Capture Data Node:
“`
Capture: {{customer_name}}
“`

### 2.2 Appointment Date Collection
Say Node:
“`
Language: English (US)
Voice: Salli
Text: “When would you like your appointment? Our appointments are 30 minutes long.
Please say the date in month and day format, for example: December 20th”
“`

Capture Data Node:
“`
Capture: {{appointment_date}}
“`

### 2.3 Check Availability (GET Request)
URL: https://i3simple.com/wp-json/wc-bookings/v1/products/slots
Headers:
“`
Authorization: Basic [your_base64_encoded_credentials]
Content-Type: application/json
“`
Parameters:
“`
product_ids=393
min_date={{appointment_date}}
max_date={{appointment_date}}
“`

### 2.4 Create Booking (POST Request)
URL: https://i3simple.com/wp-json/wc-bookings/v1/bookings
Headers: [Same as above]
Body:
“`json
{
“product_id”: 393,
“start_date”: “{{appointment_date}}T{{start_time}}”,
“end_date”: “{{appointment_date}}T{{end_time}}”,
“customer_id”: “{{recipient_number}}”,
“status”: “confirmed”
}
“`

## 3. Check Existing Appointments (Option 2)

### 3.1 Phone Verification
Say Node:
“`
Language: English (US)
Voice: Salli
Text: “I’ll help you check your appointments. Your phone number is {{recipient_number}}, is this correct?
Press 1 to confirm, 2 to enter a different number”
“`

### 3.2 Get Bookings (GET Request)
URL: https://i3simple.com/wp-json/wc-bookings/v1/bookings
Parameters:
“`
customer_phone={{recipient_number}}
“`

### 3.3 Modify Booking (PUT Request)
URL: https://i3simple.com/wp-json/wc-bookings/v1/bookings/{{booking_id}}
Body:
“`json
{
“start_date”: “{{new_date}}T{{new_time}}”,
“end_date”: “{{new_date}}T{{new_end_time}}”,
“status”: “confirmed”
}
“`

### 3.4 Cancel Booking (DELETE Request)
URL: https://i3simple.com/wp-json/wc-bookings/v1/bookings/{{booking_id}}

## 4. OpenAI Integration

### 4.1 Appointment Booking Dialog
“`
Language: English (US)
Voice: Joanna-Neural
Setup AI training: “You are a professional booking assistant. Collect customer name,
preferred date and time. Appointments are 30 minutes long.
Available times are 9 AM to 5 PM, Monday through Friday.”
Messages history: 3
Words per sec: 3
“`

### 4.2 Scheduling Confirmation
Say Node after successful booking:
“`
Language: English (US)
Voice: Salli
Text: “Great! I’ve booked your appointment for {{appointment_date}} at {{start_time}}.
You’ll receive a confirmation SMS shortly. Press 1 to go back to main menu,
or 2 to end the call.”
“`

## 5. Dynamic Variables

Key variables used across flows:
“`
{{recipient_number}} – Caller’s phone number
{{appointment_date}} – Selected appointment date
{{start_time}} – Appointment start time
{{end_time}} – Appointment end time
{{booking_id}} – Active booking reference
{{customer_name}} – Customer’s name
“`

## 6. API Response Handling

### 6.1 Successful Booking Response
“`json
{
“id”: “booking_id”,
“customer_id”: “{{recipient_number}}”,
“start_date”: “{{appointment_date}}T{{start_time}}”,
“end_date”: “{{appointment_date}}T{{end_time}}”,
“status”: “confirmed”
}
“`

### 6.2 Error Response Handling
Condition Node checks:
– If slots available
– If booking successful
– If customer exists
– If modification allowed