Account status is reflecting on this whether it is active or alive we can say in which particular mode the account is.
AppKey-AppSecret: Login authentication key (unique for every user)
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://www.oursms.in/api/account-status", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer
AppKey-
AppSecret" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
Response
{ "status": true, "data": true, "message": "Your account is activated.", "errors": [] }
Provide the vital information of current balance and basic information.
AppKey-AppSecret: Login authentication key (unique for every user)
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://www.oursms.in/api/check-balance", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer
AppKey-
AppSecret" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
Response
{ "status": true, "data": { "user_number": 111111, "name": "TESTING NAME", "email": "MAIL@MAIL>COM", "mobile": "XXXXXXXXXX", "status": "1", "transaction_balance": "5000", "promotional_balance": "5000", "otp_balance": "5000", "two_waysms_balance": 5000, "voice_sms_balance": 5000 }, "message": "Your account & balance information.", "errors": [] }
Reflection of all sender IDs list, which is approved by the system or allots by the system.
AppKey-AppSecret: Login authentication key (unique for every user)
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://www.oursms.in/api/approved-senderids", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer
AppKey-
AppSecret" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
Response
{ "status": true, "data": [ { "senderID": "ABCDEF" } ], "message": "Your approved sender ids list.", "errors": [] }
OTP will generate once the given instruction is finish with the command.
Use post method and pass parameters
AppKey-AppSecret: Login authentication key (unique for every user)
dlt_template_id: Approved DLT template id from TRAI.
mobile_number: Keep number in international format (with country code [91]) OR just use 10 digit mobile number.
Variables
v1, v2, v3, v4... Just pass the variables in the same order.
Example: If your template is [ {#var#} is your OTP for fund transfer for the amount {#var#} to {#var#} . OTP valid for 8 minutes. Do not share this OTP with anyone. ]
Suppose you pass these variables with value
v1 = 123456
v2 = Account one
v3 = Account Two
then the send template is
123456 is your OTP for fund transfer for the amount Account one to Account Two . OTP valid for 8 minutes. Do not share this OTP with anyone.
'XXXXXXXXXXXXXXXXXXX', 'mobile_number' => 'XXXXXXXXXX' 'v1' => '123456' 'v2' => 'Account one' 'v3' => 'Account Two' ]; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://www.oursms.in/api/generate-otp', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => json_encode($postData), CURLOPT_HTTPHEADER => array( 'Content-Type: application/json', 'Authorization: Bearer AppKey-
AppSecret' ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
Response
{ "status": true, "data": { "msg_length": 173, "msg_consumed_credit": 2, "token": "64faa610-abc7-11ee-a02b-75ac21154640" }, "message": "message successfully sent.", "errors": [] }
Here the option of verify OTP once the OTP generate.
Use post method and pass parameters
AppKey-AppSecret: Login authentication key (unique for every user)
otp_number: enter 4, 5, or 6 digit OTP.
<?php $postData = [ 'otp_number' => '123456' ]; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://www.oursms.in/api/
verify-otp", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => json_encode($postData), CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer
AppKey-
AppSecret" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
Response
{ "status": true, "data": "ffadb730-6c3d-11eb-bf21-81ef5a1693f6", "message": "Otp verified.", "errors": [] }
With this option, any kind form of SMS can be sent for communication direct or indirect.
Promotional and Transactional SMS
"dlt_template_id" : "XXXXXXXXXXXXXXXXXXX", //required, Approved DLT template id from TRAI.
"campaign" : "Test Campaign", //Fill or blank
"mobile_numbers" : "XXXXXXXXXX,XXXXXXXXXX", //numbers will be comma seprated
"message" : "Your message here...", //Fill or blank, if your DLT template has variable then fill this field otherwise no need to fill this.
"message_type" : "0", //0: English OR 1: Unicode || by default send as English message
"route_type" : "0", //0:Transactional, 1:Promotional || by default route is Promotional
"schedule_date": "", //if user want to send this SMS in a particular date and time format will be YYYY-MM-DD HH:MM (time 24Hrs format)
"is_flash" : "" // If user want to send the message as a flash message then Y: Yes / N: No or blank
$postData = [ 'dlt_template_id' => 'XXXXXXXXXXXXXXXXXXX', 'campaign' => 'Test', 'mobile_numbers' => 'XXXXXXXXXX,XXXXXXXXXX', 'message' => 'Testing message', 'message_type' => '0', 'route_type' => '0', 'schedule_date' => '', 'is_flash' => '' ];
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://www.oursms.in/api/send-message', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>
json_encode($postData), CURLOPT_HTTPHEADER => array( 'Content-Type: application/json', 'Authorization: Bearer
AppKey-AppSecret'), )); $response = curl_exec($curl); curl_close($curl); echo $response;
Response
{ "status": true, "data": { "msg_length": 173, "msg_consumed_credit": 2, "token": "64faa610-abc7-11ee-a02b-75ac21154640" }, "message": "message successfully sent.", "errors": [] }
Highlight the report of SMS which had been sent.
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://www.oursms.in/api/send-report/80bc12b0-a7e5-1ssa-931c-dss42dcae7c2", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer AppKey-
AppSecret" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
Response
{ "status": true, "data": { "id": xxxxx, "campaign_name": "Test", "sender_id": "ABCDEF", "sms_type": "SMS", "message": "Testing message", "message_type": "English", "msg_length": 12, "msg_consumed_credit": 1, "is_flash": "N", "scheduled_date": null, "scheduled_hour": null, "scheduled_minutes": null, "total_contacts": 2, "total_credit_use": 2, "total_block_invalid_number": 0, "currently_delivered": 2, "currently_failed": 0, "campaign_current_stage": "Completed", "send_numbers": [ { "id": 1, "send_sms_id": xxxxx, "mobile": "91XXXXXXXXXX", "used_credit": 1, "status_code": "1", "submitDate": "
yyyy-mm-dd hh:ii:ss", "doneDate": "
yyyy-mm-dd hh:ii:ss", "status": "DELIVRD", "reason": null }, { "id": 2, "send_sms_id": xxxxx, "mobile": "91xxxxxxxxxx", "used_credit": 1, "status_code": "1", "submitDate": "
yyyy-mm-dd hh:ii:ss", "doneDate": "
yyyy-mm-dd hh:ii:ss", "status": "DELIVRD", "reason": null } ] }, "message": "SMS Report.", "errors": [] }
Templates list can be check from here.
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://www.oursms.in/api/templates', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( 'Content-Type: application/json', 'Authorization: Bearer
AppKey-
AppSecret' ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
Response
{ "status": true, "data": [ { "template_id": "0895ddc0-91fd-11eb-84bb-e7d749c95410", "template_name": "test", "entity_id": "XXXXXXXXXXXXXXXXXXX", "dlt_header_id": "XXXXXXXXXXXXXXXXXXX", "is_for_unicode": 0, "dlt_message_template": "testing messagew", "dlt_template_id": "XXXXXXXXXXXXXXXXXXX", "status": 0 }, { "template_id": "6e6765a0-91fd-11eb-a59f-873c5c1207d2", "template_name": "test ubu", "entity_id": "XXXXXXXXXXXXXXXXXXX", "dlt_header_id": "XXXXXXXXXXXXXXXXXXX", "is_for_unicode": 0, "dlt_message_template": "Your request for {#var#} sent to {#var#} for Approval. SMS/Mail will send if request is approved. Please note - Your mobile number {#var#} is your application number.", "dlt_template_id": "XXXXXXXXXXXXXXXXXXX", "status": 0 } ], "message": "Your template list.", "errors": [] }
All campaigns can be accessed by the user with this list from where the data is accessible.
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://www.oursms.in/api/campaign-list-pagination", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer
AppKey-
AppSecret" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
Response
{ "status": true, "data": { "current_page": 1, "data": [ { "campaign_name": "1", "sender_id": "ABCSEF", "sms_type": "TWOWAY", "message": "Hello, my name is Jhon Doe and Please rate my skills through below link {{2way-sms-link-1}}", "message_type": "English", "msg_length": 91, "msg_consumed_credit": 1, "is_flash": "N", "scheduled_date": null, "scheduled_hour": null, "scheduled_minutes": null, "total_contacts": 6, "total_credit_use": 6, "total_block_invalid_number": 0, "currently_delivered": 0, "currently_failed": 0, "campaign_current_stage": "In-process" }, { "campaign_name": "test", "sender_id": "NRTSMS", "sms_type": "TWOWAY", "message": "link1 {{2way-sms-link-3}} and link2{{2way-sms-link-2}}", "message_type": "English", "msg_length": 54, "msg_consumed_credit": 1, "is_flash": "N", "scheduled_date": null, "scheduled_hour": null, "scheduled_minutes": null, "total_contacts": 2, "total_credit_use": 2, "total_block_invalid_number": 0, "currently_delivered": 0, "currently_failed": 0, "campaign_current_stage": "In-process" }, { "campaign_name": "OTP", "sender_id": "NRTSMS", "sms_type": "SMS", "message": "{{OTP}} is your OTP for testing.", "message_type": "English", "msg_length": 31, "msg_consumed_credit": 1, "is_flash": "N", "scheduled_date": null, "scheduled_hour": null, "scheduled_minutes": null, "total_contacts": 1, "total_credit_use": 1, "total_block_invalid_number": 0, "currently_delivered": 0, "currently_failed": 0, "campaign_current_stage": "Pending" } ], "first_page_url": "https://www.oursms.in/api/campaign-list-pagination?page=1", "from": 1, "last_page": 1, "last_page_url": "https://www.oursms.in/api/campaign-list-pagination?page=1", "next_page_url": null, "path": "https://www.oursms.in/api/campaign-list-pagination", "per_page": 5, "prev_page_url": null, "to": 3, "total": 3 }, "message": "Your all types of campaign list with current stage.", "errors": [] }
Campaign list with specific data of particular campaign.
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://www.oursms.in/api/campaign-list", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer
AppKey-
AppSecret" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
Response
{ "status": true, "data": [ { "campaign_name": "1", "sender_id": "ABCDEF", "sms_type": "TWOWAY", "message": "Hello, my name is Jhon Doe and Please rate my skills through below link {{2way-sms-link-1}}", "message_type": "English", "msg_length": 91, "msg_consumed_credit": 1, "is_flash": "N", "scheduled_date": null, "scheduled_hour": null, "scheduled_minutes": null, "total_contacts": 6, "total_credit_use": 6, "total_block_invalid_number": 0, "currently_delivered": 0, "currently_failed": 0, "campaign_current_stage": "In-process" }, { "campaign_name": "test", "sender_id": "ABCDEF", "sms_type": "TWOWAY", "message": "link1 {{2way-sms-link-3}} and link2{{2way-sms-link-2}}", "message_type": "English", "msg_length": 54, "msg_consumed_credit": 1, "is_flash": "N", "scheduled_date": null, "scheduled_hour": null, "scheduled_minutes": null, "total_contacts": 2, "total_credit_use": 2, "total_block_invalid_number": 0, "currently_delivered": 0, "currently_failed": 0, "campaign_current_stage": "In-process" }, { "campaign_name": "OTP", "sender_id": "ABCDEF", "sms_type": "SMS", "message": "{{OTP}} is your OTP for testing.", "message_type": "English", "msg_length": 31, "msg_consumed_credit": 1, "is_flash": "N", "scheduled_date": null, "scheduled_hour": null, "scheduled_minutes": null, "total_contacts": 1, "total_credit_use": 1, "total_block_invalid_number": 0, "currently_delivered": 0, "currently_failed": 0, "campaign_current_stage": "Pending" } ], "message": "Your all types of campaign list with current stage.", "errors": [] }
dlt_template_name : "Any name | required",
sender_id: "Registered SENDER ID | 6 CHAR | required",
dlt_message: "This is your dummy template with {#var#} | required",
dlt_template_id: "DLT Template | required",
is_unicode: "n OR y" // n for No, Y for Yes | Default : n
$postData = [ 'dlt_template_name' =--> 'Any Name', 'sender_id' => 'XXXXX' 'dlt_message' => 'This is your dummy template with {#var#}' 'dlt_template_id' => 'xxxxxxxxxxxxxxxxx' 'is_unicode' => 'n' ]; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://www.oursms.in/api/add-template', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>
json_encode($postData), CURLOPT_HTTPHEADER => array( 'Content-Type: application/json', 'Authorization: Bearer
AppKey-AppSecret' ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
Response
{ "status": true, "data": { "dlt_template_name": "Any Name", "entity_id": "xxxxxxxxxxxxxx", "sender_id": "XXXXXX", "header_id": "xxxxxxxxxxxxxxxxx", "is_unicode": 0, "dlt_message": "This is your dummy template with {#var#}", "dlt_template_id": "xxxxxxxxxxxxxx", "status": 1, "uuid": xxxxxxxx-xxxx-xxxx-xxxx-xxxxxx", "created_at": "2023-11-28T08:39:12.000000Z" }, "message": "DLT Template successfully added.", "errors": [] }