Hi Team,
I’m trying to integrate a Realtime Agent with our external EHR REST API to retrieve patient information before creating an appointment.
Environment
- VitalPBX (latest version)
- Realtime Agent
- External REST API built with Java Spring Boot
- HTTPS endpoint with a valid SSL certificate
Integration Configuration
Base URL
https://mydomain
Endpoint
POST /public/getPatientInfo
Request Body
{ "last_name": "{{patient_last_name}}", "first_name": "{{patient_first_name}}", "dob": "{{patient_dob}}", "patient_phone": "{{patient_phone}}"}
Parameters
- patient_first_name
- patient_last_name
- patient_dob
- patient_phone
Execution Mode:
Execute Immediately
API Behavior
The endpoint works correctly when tested from Postman.
Request:
POST https://mydomain/public/getPatientInfo
Body:
{ "last_name": "new", "first_name": "testing", "dob": "2025-01-01", "patient_phone": "312312312"}
Response:
{ "key": "patientId", "value": "52410135683"}
HTTP Status:
200 OK
Average response time:
~1.5 seconds
Problem
When the Realtime Agent collects the required information and attempts to execute the integration, it responds with the configured error message:
“I’m sorry, I couldn’t complete that action right now.”
However:
- The endpoint works perfectly from Postman.
- The endpoint is publicly accessible.
- The API returns HTTP 200.
- No request reaches the Spring Boot application when invoked from the Realtime Agent (based on server-side logging).
This suggests that the API call may not be executed at all, or it is failing before reaching the endpoint.
Questions
- Is there a way to view the raw HTTP request generated by the Realtime Agent?
- Are there logs showing:
- whether the tool was invoked,
- the request payload,
- the response received,
- or any parsing errors?
- Does the request body template require placeholders to be wrapped in quotes?
For example:
{ "last_name": "{{patient_last_name}}"}
instead of
{ "last_name": {{patient_last_name}}}
- Is it necessary to explicitly add the following headers?
Content-Type: application/jsonAccept: application/json
- Are there any limitations on the response format? Is the following response supported?
{ "key": "patientId", "value": "52410135683"}
or should the API instead return something like:
{ "patientId": "52410135683"}
Additional Information
I checked the Asterisk/PJSIP logs but only found SIP registration and transport-related messages. I could not find any logs related to the Realtime Agent integration or outgoing HTTP requests.
If there is a way to enable debug logging for Realtime Agent integrations or outbound API calls, I’d appreciate any guidance.
Thank you!