Scroll Top
Level 17/31 Queen St, Melbourne. VIC. 3000

API Events

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. Login to the Dashboard if not already by using this link – https://dashboard.url.net.au
  2. Select Services and select the PBX service to manage by clicking the associated wrench icon.
  3. Select Call Routing then Dialplans
  4. Edit the Condition you want to add the API Event to
  5. From the Available Actions add the API Event action
  6. 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
  7. Hit Save

Data Post

When using the API Events action the following data will be sent to your URL as a standard HTTP POST.  
Parameter NameDescription
dialed_numberThe number that was dialed, this is the external number assigned to the dialplan.  Also commonly known as a “DID”
caller_id_numberPhone number of the person calling
dialplan_idUnique ID of the dialplan the API event is assigned to
condition_idUnique ID of the condition the API event is assigned to
dialplan_nameName of the dialplan the API event is assigned to
condition_nameName 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
 

Related Posts