curl -X GET http://your-service-url.com/webhook.php?parameter1=<call log value>¶meter2= <another call log value> |
// If you have set Query string parameters, you can still get them here too. $some_value = $_GET['parameter1']; |
myoperator= { "id": "5f25296c4122c135", "uid": "n2.1596270949.2175190", "reference_id": "fd771ed0-d3d1-11ea-935a-9a5b7644c4f0", "company_id": "5cd40f6554442586", "clid_raw": "919711636496", "clid": "9711636496", "rdnis": "unknown", "call_state": "1", "event": "2", "status": null, "users": [ "918586848544" ], "created": "2020-08-01 08:35:56", "call_time": "2020-08-01 08:35:56", "public_ivr_id": "5ee9a795b318a786", "client_ref_id": "fdfdfdf", "job_id": null } |
curl -X POST http://your-service-url.com/webhook.php -d myoperator=<call log> |
$call_data = $_POST['myoperator']; /* The data is in this string format: {"_ai": "xyz", "_ci": "123abc", ...} Hence you should decode it to array to get particular call data */ $call_data_array = json_decode($call_data, true); // get caller's number $caller_number = $call_data_array['_cr']; /* Remember, POST request doesn't mean you won't get query parameters. If you have set Query string parameters, you can still get them here too. */ $caller_numer = $_GET['caller_number']; |
["my-super-secret-token: abc123def"] |
curl -X POST http://your-service-url.com/webhook.php -H 'my-super-secret-token: abc123def' |
$my_secret_header = $_SERVER['HTTP_my-super-secret-token']; if( $my_secret_header == 'abc123def' ) { // Request come from MyOperator webhook echo "Good"; } else { // Request didn't came from MyOperator webhook echo "Bad"; } |
{"username": "admin", "password": "123456"} |
curl -u admin:123456 http://your-service-url.com/webhook.php |
curl -XGET http://your-service-url.com/webhook.php?caller_number=+919999999999 |
$caller_number = $_GET['caller_number']; echo $caller_number; //+919999999999 |
curl -XPOST http://your-service-url.com/webhook.php?caller_number=+919876543210 -d myoperator= <call log> |
call state value |
Description |
Type of call |
1 |
Incoming call on server |
OBD + incoming |
2 |
call finished |
OBD + incoming |
3 |
call initiated by user to customer |
Click to call |
4 |
first party no answer |
OBD |
5 |
dialing users |
OBD + incoming |
6 |
user answered |
OBD + incoming |
7 |
client rejected the call |
Click to call |
9 |
no user picked the call (no answer) |
Click to call |
Log field name |
Meaning |
Example |
clid_raw |
Caller's number (raw) |
919999999999 |
clid |
Caller's number (formatted) |
+919999999999 |
created |
Call log creation time |
2016-11-23 13:26:15 |
event |
Call event type |
1=incoming, 2=outgoing |
status |
Call status |
1 |
call_state |
Call state |
1 |
company_id |
Company ID |
abcdef123 |
rdnis |
Service number |
9999999999 |
uid |
Call unique ID |
sn.1572424727.994 |
users |
comma separated agent ids |
abc123,def456 |
reference_id |
reference ID generated in OBD process |
fd771ed0-d3d1-11ea-935a-9a5b7644c4f0 |
public_ivr_id |
IVR ID of campaign |
5ee9a795b318a786 |
client_ref_id |
reference ID given by the client |
fdfdfdf |