Project

General

Profile

Caller Data Retrieval via Webservice

Webservice (REST API) will be accessed by PBX via an URL, like the one below:

http://example.com/api/while1voice?telephone=0700000000&dnid=0210000000
PBX Server will send the following parameters, using GET:
  • telephone => the customer's telephone number (Caller ID)
  • dnid => the phone number that has been called (or the outgoing number, in case of outbound)
Your server will respond - using JSON, the following data:
  • id => Internal customer ID
  • name => name, first name
  • backend_link => popup link for Incoming Call Answer
  • direct_line => used for Inbound calls for direct transfer to agent or queue (e.g. SIP/ion-popescu or sales-queue), optional
  • queue_position => Queue position, 0-100 / NULL, optional
  • route_identifier => Special Route Identifier, used in overriding Outbound Number in PBX - Inbound routes (e.g.: call to eMAG MKTP clients)

The "route_identifier" parameter is used together with the Unique Identifier External identifier, configured in the Inbound routes GUI section, for Outbound calls.

Examples:

Caller Data Retrieval via Webservice:

$contact_info = $db->get_row("SELECT * FROM contacts WHERE telephone = '" . $db->escape($_GET['telephone']) . "'");

Sending information:

$result = array(
    'id' => 12345,
    'name' => 'John Doe',
    'queue_position' => null,
    'direct_line' => null,
    'backend_link' => 'https://your-crm.com/example-popup?id=12345',
    'route_identifier' => null
);

header('Content-Type: application/json');
echo json_encode($result);

Response contact found - json:

{

    "id": 12345,
    "name": "John Doe",
    "queue_position": null,
    "direct_line": null,
    "backend_link": "https://your-crm.com/example-popup?id=12345",
    "route_identifier": null

}

Response non-existent contact - json:

{

    "id": null,
    "name": null,
    "queue_position": null,
    "direct_line": null,
    "backend_link": null,
    "route_identifier": null

}

Connecting to MySQL is allowed from PBX's dedicated IP address, so it needs to be whitelisted.
To make it possible to send the extracted Caller ID via Webservice to the agent answering the call, continue with the steps described at item 2 - Caller ID Pop-up section.

The URL will be set on each project (API URL), and parameters for each type of API according to the data below (Help section)

Api params usage:
Generic: type=json&root_tag=&send_request_headers=0&ignore_response=0
Salesforce: username=&password=&token=&contact_url=&custom_url=&webservices[send_call][xml]=CreateActivitiesWebService&webservices[send_call][method]=sendCallInfo
Soap: func_name=getCallerInfo&init_params[login]=asdf&init_params[password]=1234&func_params[do_something]=true
Ticketsys: -
MiniCRM: SystemId=&APIKey=
Freshdesk: domain=&user=&password=
Pipedrive: domain=&user=&token=


Available in other languages: RO

Go to top