Web Hooks
Webhooks can be registered to receive events generated by phone calls on the Truly platform. The user supplied URL will be POSTed to for each event. The Truly system will retry requests on non-200 HTTP response codes.
Request Properties
Request Type | HTTP POST |
Content-Type | application/json |
User Agent | "Truly Web Hook v0.1" |
Webhook URL | User Defined |
Phone Calls
Request Body
{
event_type: "call_ended",
phonecall_id: "TCA124299504",
licensegroup_id: 1,
phonecall: {
id: "TCA124299504",
time_in_queue: 123,
time_to_pickup: 17,
time_to_response: null,
outbound_number: null,
caller_email: “erol@trulywireless.com”,
caller_number: "+16463748603",
start_time: "2016-01-15T20:07:07Z",
duration: 182,
queued: true,
recipient_email: “simon@trulywireless.com”,
recipient_extension_id: 143,
note: null,
recipient_number: "+12674334722",
dialed_users: "143 154",
dialed_zero: false,
reply_to_phonecall_id: null,
missed: true,
status: "completed",
target: "phone-menu",
city: "New York",
region: "NY",
country: "US",
direction: "inbound",
inbound_number: "+12674334722",
caller_extension_id: null}
}
Fields
Field | Values | Description |
eventy_type | call_start, call_answered, call_ended, recording_ready, voicemail | The type of call event |
licensegroup_id | integer | An identifier for the company’s truly account |
status | no-answer, busy, completed, failed, in-progress, ringing, queued | The current status of the phone call |
direction | inbound, outbound | inbound - a call to a Truly user outbound - a call made by a Truly user |
target | direct, phone-menu, transfer | The type of call the event is for. direct - a direct call to a person phone-menu - call to a phone tree transfer - a transferred call |
queued | true, false | Indicates whether the call has been queued |
caller_extension_id | integer | The id of the Truly user that made an outbound call. |
recipient_extension_id | integer | The id of the Truly user that received an inbound call. |
dialed_users |
| DEPRECATED |
SMS
Request Body
{
"event_type": "sms_pending",
"licensegroup_id": 1,
"sms": {
"uuid": "ffb785b5-62cd-4d98-b326-2e05a22b9538",
"sender": "+16465551000",
"recipient": "+12125659000",
"body": "This is an SMS body",
"status": "pending",
"direction": “outbound”,
"sent_date": "2018-03-18T123213",
"delivered_date": "2018-231232"
}
"sender": {
"account_id": 1234,
"extension_id": 54654,
“name”: "Test Tester",
“first_name”: "Test",
“last_name”: "Tester",
"email": "test@truly.co",
"timezone": "America/New York"
}
}
Fields
Field | Values | Description |
event_type | sms_pending, sms_delivered, sms_failed, sms_received | The type of SMS event |
sms.direction | inbound, outbound | Whether this was an sms that was sent of received. |
sms.status | pending, delivered, failed, received | The current status of the SMS |