URL Networks

API Events

You are here: Help Hosted PBX API Events


API Events are used to be able to send a POST event to a designated end point. At this point Incoming Call is the only option available however, others may be added in the future.

Adding the Event Action

The API Event action is added to the Dialplan Condition section in the URL Dashboard.  Use the steps below to add the action:
  1. Manage your Hosted PBX service
  2. Select Call Routing then Dialplans
  3. Edit the Condition you want to add the API Event to
  4. From the Available Actions add the API Event action
  5. Complete the form below:
    1. HTTP Basic Username - If your endpoint uses HTTP basic authentication enter the username here, leave it blank if HTTP authentication is now used
    2. HTTP Basic Password - Set the password for your endpoint, or leave blank if not using HTTP basic authentication
    3. HTTP POST URL - The URL we send the POST data to
  6. Click Save to apply the changes

Data Post

When using the API Events action the following data will be sent to your URL as a standard HTTP POST.  
Parameter Name Description
dialed_number The number that was dialed, this is the external number assigned to the dialplan.  Also commonly known as a “DID”
caller_id_number Phone number of the person calling
dialplan_id Unique ID of the dialplan the API event is assigned to
condition_id Unique ID of the condition the API event is assigned to
dialplan_name Name of the dialplan the API event is assigned to
condition_name Name of the condition the API event is assigned to

Test using CURL

You can use the following test command to emulate what the server will send to your URL.



curl -X POST --data "dialed_number=61312341234&caller_id_number=61412341234&dialplan_id=1&condition_id=2&dialplan_name=Test&condition_name=Business Hours" http://example.com/test.php

NB: Replace http://example.com/test.php with the endpoint that is configured to receive events

With Authentication

curl -u username:password -X POST --data "dialed_number=61312341234&caller_id_number=61412341234&dialplan_id=1&condition_id=2&dialplan_name=Test&condition_name=Business Hours" http://example.com/test.php

NB: Replace http://example.com/test.php with the endpoint that is configured to receive events