Server URLs allow your application to receive data & communicate with Interactly during conversations. Conversation events can include:
- Status Updates (status-update): updates on the status of a call
- Call Updates (conversation-update): updates on the messages of a call
- Hang Notifications (hang): get notified when your assistant fails to reply for a certain amount of time
- End of Call Report (end-of-call-report): call summary data at the end of a call
All messages sent to your Server URL will be POST requests with the following body:
{
"message": {
"type": "status-update",
"call": { Call Object },
"assistant": { Assistant Object },
"phone": { Phone Object },
"customer": { Customer Object },
"analysis": { Analysis Object },
"messages": { Messages Object[] },
...other message properties
}
}
They include the type of message, the call object, and any other properties that are relevant to the message type. Below are the different types of messages that can be sent to your Server URL.
Call Status Updates
During the call, the assistant will make multiple POST requests to the Server URL with the following body:
{
"message": {
"type": "status-update",
"status": "completed",
"call": { Call Object },
}
}
Calls Status
A call can have one of the following statuses:
queued: The call has been initiated.
ongoing: The call has started.
finished: The call has ended.
forwarded: The call has forwarded.
Conversation Status Updates
During the call, the assistant will make multiple POST requests to the Server URL with the following body:
Call Object will include messages also.
{
"message": {
"type": "conversation-update",
"call": { Call Object },
}
}
Hang Notifications
Whenever the assistant fails to respond for 5+ seconds, the assistant will make a POST requests to the Server URL with the following body:
{
"message": {
"type": "hang",
"call": { Call Object },
}
}
End of Call Report
When a call ends, the assistant will make a POST request to the Server URL with the following body:
{
"message": {
"type": "end-of-call-report",
"call": { Call Object },
"analysis": {
"summary": "The user picked up the phone then asked about the weather...",
"successEvaluation": "success",
"structuredData": {
"name": "Suresh",
"age": 29
}
},
"messages":[
{
"messageId": "a12f9c88-c155-461f-9771-4d240cdc9a04",
"text": "Hello! How can I help you?",
"timestamp": "2020-10-05T10:10:01.000Z",
"role": "assistant"
},
{
"messageId": "a12f9c88-c155-461f-9771-4d240cdc9a04",
"text": "What's the weather?",
"timestamp": "2020-10-05T10:10:02.000Z",
"role": "user"
}
]
}
}
You can use this to display an error message to the user, or to send a notification to your team.
Interactly fully supports OpenAI’s function calling
API, so you can have assistants
ping your server to perform actions like sending emails, retrieve information, and more.
With each response, the assistant will automatically determine what functions to call based on the directions provided in the system message in messages. Here’s an example of what the assistant might look like:
If you define a tool in the following format and attach it to an assistant, you can use it effectively. Learn
{
"name": "sendEmail",
"description": "Used to send an email to a client.",
"parameters": {
"type": "object",
"properties": {
"emailAddress": { "type": "string" }
}
}
}
Once a tool is triggered, the assistant will send a message to your Server URL with the following body:
Your server should respond with a JSON object containing the function’s response, like so:
{ "result": "Your email has been sent." }
Or if it’s an object:
{
"result": "{ \"message\": \"Your email has been sent.\", \"email\": \"[email protected]\" }"
}
The result will be appended to the conversation, and the assistant will decide what to do with the response based on its system prompt.
If you don’t need to return a response, you can use the async: true parameter in your assistant’s
tool configuration. This will prevent the assistant from waiting for a response from your
server.