ayazrayani
06/17/2026, 5:59 AMAI Evy
06/17/2026, 5:59 AMAI Evy
06/17/2026, 6:00 AMAI Evy
06/17/2026, 6:00 AMAI Evy
06/17/2026, 6:00 AMAI Evy
06/17/2026, 6:00 AMayazrayani
06/17/2026, 6:03 AMayazrayani
06/17/2026, 6:04 AMAI Evy
06/17/2026, 6:04 AMAI Evy
06/17/2026, 6:05 AMAI Evy
06/17/2026, 6:05 AMAI Evy
06/17/2026, 6:05 AMAI Evy
06/17/2026, 6:05 AMayazrayani
06/17/2026, 6:06 AMAI Evy
06/17/2026, 6:06 AMAI Evy
06/17/2026, 6:07 AMjavascript
// Example: Make API call to PMS
const response = await fetch("<https://api.example.com/submit%22,> {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ name: dv.customer_name })
}) ;
3. Pass Dynamic Variables [(3) ]()
When creating calls via API, inject guest information as dynamic variables :AI Evy
06/17/2026, 6:07 AM{
"agent_id": "YOUR_RETELL_AGENT_ID",
"to": "{{phone}}",
"from": "+1XXXXXXXXXX",
"variables": {
"first_name": "{{first_name}}",
"check_in_date": "{{check_in_date}}",
"room_type": "{{room_type}}"
}
}
4. Extract Booking Details [(4) ]()
Use the Extract Dynamic Variables tool to capture guest information during the conversation :
- Guest name (Text)
- Phone number (Text)
- Check-in/check-out dates (Text)
- Room preferences (Enum)
Important Notes:
- Custom Functions support GET, POST, PUT, PATCH, and DELETE requests with custom headers and query parameters [(5) ]()
- You can add custom headers for API authentication
- The Code Tool is limited to 5,000 characters and doesn't support external packages [(2) ]()
- For secure integrations requiring authentication or write access to production systems, use Custom Functions hosted on your backend rather than Code Tool
You'll need to work with Choice Advantage's API documentation to determine the exact endpoints and authentication method required for room bookings.AI Evy
06/17/2026, 6:07 AMAI Evy
06/17/2026, 6:07 AM