Webhooks give you the ability to receive a structured payload of data at the URL of your choice when certain events occur. To get started, set up a URL to receive events, then register it in net2phone.
A call is ringing. Triggers when an incoming call is ringing on any phone number in your net2phone account, or when an outgoing call is ringing its destination.
inbound & outbound
Payload
| Field | Description |
|---|---|
| id | String that is unique per message. |
| event | "call_ringing" |
| timestamp | UTC timestamp of the event. |
| direction | One of inbound, outbound. Inbound is a call ringing on a net2phone line. Outbound is a call made from a net2phone line. |
| originating_number | The number that started the phone call. |
| dialed_number | The recipient of the phone call. |
| user_name | The full display name of the Unite user who originated or received the call. |
Example
{
"id": "c998e523-3750-4ff4-9eac-76af1dc360b1",
"event": "call_ringing",
"timestamp": "2019-09-15T12:44:22Z",
"direction": "inbound",
"originating_number": "+15551112222",
"dialed_number": "+17778885555",
"user_name": "John Doe"
}A call is answered. Triggers when an incoming call is answered on any phone number in your net2phone account, or when an outgoing call is answered by its destination.
inbound & outbound
Payload
| Field | Description |
|---|---|
| id | String that is unique per message. |
| event | "call_answered" |
| timestamp | UTC timestamp of the event. |
| direction | One of inbound, outbound. Inbound is a call answered on a net2phone line. Outbound is an answered call made from a net2phone line. |
| originating_number | The number that started the phone call. |
| dialed_number | The recipient of the phone call. |
| user_name | The full display name of the Unite user who originated or received the call. |
Example
{
"id": "c998e523-2750-4ff4-9eac-76af1dc360b2",
"event": "call_answered",
"timestamp": "2019-07-18T12:44:25Z",
"direction": "inbound",
"originating_number": "+15551112222",
"dialed_number": "+17778885555",
"user_name": "John Doe"
}A call is answered and completed successfully. Triggers when an incoming call is completed on any phone number in your net2phone account, or when an outgoing call is completed.
inbound & outbound
Payload
| Field | Description |
|---|---|
| id | String that is unique per message. |
| event | "call_completed" |
| timestamp | UTC timestamp of the event. |
| direction | One of inbound, outbound. |
| duration | The number of seconds the call lasted. Only set for call_completed events. |
| recorded | true if the call was recorded. Only set for call_completed events, and only if true. |
| originating_number | The number that started the phone call. |
| dialed_number | The recipient of the phone call. |
| user_name | The full display name of the Unite user who originated or received the call. |
Example
{
"id": "c998e523-2750-4ff4-9eac-76af1dc360b3",
"event": "call_completed",
"timestamp": "2019-09-15T12:45:25Z",
"direction": "inbound",
"duration": 60,
"recorded": "true",
"originating_number": "+15551112222",
"dialed_number": "+17778885555",
"user_name": "John Doe"
}A call is not answered by the recipient. Triggers when an incoming call is not answered by any phone in your net2phone account.
inbound only
Payload
| Field | Description |
|---|---|
| id | String that is unique per message. |
| event | "call_missed" |
| timestamp | UTC timestamp of the event. |
| direction | "inbound" |
| originating_number | The number that started the phone call. |
| dialed_number | The recipient of the phone call. |
| user_name | The full display name of the Unite user who originated or received the call. |
Example
{
"id": "c998e523-2750-4ff4-9eac-76af1dc360b3",
"event": "call_missed",
"timestamp": "2019-09-15T12:45:25Z",
"direction": "inbound",
"originating_number": "+15551112222",
"dialed_number": "+17778885555",
"user_name": "John Doe"
}A voicemail was left for a net2phone user. Triggers when an incoming call is not answered by any phone in your net2phone account and a voicemail is recorded.
inbound only
Payload
| Field | Description |
|---|---|
| id | String that is unique per message. |
| event | "voicemail_received" |
| timestamp | UTC timestamp of the event. |
| direction | "inbound" |
| duration | The number of seconds the voicemail lasted. |
| originating_number | The number that started the phone call. |
| dialed_number | The recipient of the phone call. |
| user_name | The full display name of the Unite user who originated or received the call. |
Example
{
"id": "c998e523-2750-4ff4-9eac-76af1dc360b3",
"event": "voicemail_received",
"timestamp": "2019-09-15T12:45:25Z",
"direction": "inbound",
"originating_number": "+15551112222",
"dialed_number": "+17778885555",
"user_name": "John Doe"
}Conventions
[10|<any number>] — the | symbol means OR. Default values for optional parameters are shown in bold.HTTP Status Codes
| Code | Description |
|---|---|
| 200 | OK |
| 201 | Created |
| 202 | Accepted (request accepted and queued for execution) |
| 400 | Bad Request |
| 401 | Authentication Failure |
| 403 | Forbidden |
| 404 | Resource Not Found |
| 405 | Method Not Allowed |
| 409 | Conflict |
| 412 | Precondition Failed |
| 413 | Request Entity Too Large |
| 500 | Internal Server Error |
| 501 | Not Implemented |
| 503 | Service Unavailable |