<?php // Variables $key="YOUR-ACCOUNT-KEY"; $reference="MESSAGE-REFERENCE-NUMBER"; $req="COMMAND"; $used_route="MESSAGE-ROUTE"; $arrContextOptions=array( "ssl"=>array( "verify_peer"=>false , "verify_peer_name"=>false , ), ); $data = file_get_contents("https://api.textng.xyz/deliveryreport/?key=$key&reference=$reference&req=$req&used_route=$used_route" , false, stream_context_create($arrContextOptions)); $decode =json_decode ($data); $extracted_data = $decode->D->details;foreach ($extracted_data as $extracted_data_info) {echo $phone_number = $extracted_data_info->number;echo $status = $extracted_data_info->status;echo $track_id = $extracted_data_info->track_id; } ?>
<?php // Your variables $key = "YOUR-ACCOUNT-KEY"; $reference = "MESSAGE-REFERENCE-NUMBER"; $req = "COMMAND"; $used_route = "MESSAGE-ROUTE"; $response = httpPost("https://api.textng.xyz/deliveryreport_post/" ,array("key"=>"$key","reference"=>"$reference","req"=>"$req","used_route"=>"$used_route")); // using php curlfunction httpPost($url, $data) { $curl =curl_init ($url);curl_setopt ($curl, CURLOPT_POST, true);curl_setopt ($curl, CURLOPT_POSTFIELDS, http_build_query($data));curl_setopt ($curl, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($curl); curl_close($curl);echo $response; $decode =json_decode ($response); $extracted_data = $decode->D->details;foreach ($extracted_data as $extracted_data_info) {echo $phone_number = $extracted_data_info->number;echo $status = $extracted_data_info->status;echo $track_id = $extracted_data_info->track_id;} } ?>
Parameters | Example | Description |
---|---|---|
Key | XXXXX-XXXX-XXXXX | This can be found in the Developers page of your dashboard. The key authorizes the transaction. |
Reference | XXXXXXXXXX | This is the reference number generated for each sms sent. you'll get this in the DLR page, and it is also displayed when you use the API to send message |
req | All / DND / Success |
This specifies the type of numbers you want in the report. Valid types of command are: all: To get both delivered and blocked(if message was sent via route 2)/sent via bypass route numbers seperated and shown in the report dnd: To get only the numbers that were blocked(if message was sent via route 2) OR messages sent via bypass route success: To get only the numbers that were delivered to successfully |
used_route | 2 / 5 / 6 | This specifies the message route you used to send the sms you want the report. |