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)
var client = new RestClient("https://www.oursms.in/api/account-status"); client.Timeout = -1; var request = new RestRequest(Method.GET); request.AddHeader("Content-Type", "application/json"); request.AddHeader("Authorization", "Bearer AppKey-
AppSecret"); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
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)
var client = new RestClient("https://www.oursms.in/api/check-balance"); client.Timeout = -1; var request = new RestRequest(Method.GET); request.AddHeader("Content-Type", "application/json"); request.AddHeader("Authorization", "Bearer AppKey-
AppSecret"); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
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": [] }
var client = new RestClient("https://www.oursms.in/api/approved-senderids"); client.Timeout = -1; var request = new RestRequest(Method.GET); request.AddHeader("Content-Type", "application/json"); request.AddHeader("Authorization", "Bearer
AppKey-
AppSecret"); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
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.
var dlt_template_id = "XXXXXXXXXXXXXXXXXXX"; var mobile_number = "XXXXXXXXXX"; var postData = new { dlt_template_id = dlt_template_id, mobile_number = mobile_number }; var jsonObject = JsonConvert.SerializeObject(postData);
var client = new RestClient("https://www.oursms.in/api/generate-otp"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddHeader("Authorization", "Bearer AppKey-
AppSecret"); request.AddParameter("application/json", jsonObject, ParameterType.RequestBody); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
Response
{ "status": true, "data": { "token": "ffadb730-6c3d-11eb-bf21-81ef5a1693f6" }, "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.
var otp_number = "123456"; var postData = new { otp_number = otp_number, }; var jsonObject = JsonConvert.SerializeObject(postData);
var client = new RestClient("https://www.oursms.in/api/verify-otp"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddHeader("Authorization", "Bearer AppKey-
AppSecret"); request.AddParameter("application/json", jsonObject, ParameterType.RequestBody); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
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
var dlt_template_id = 'XXXXXXXXXXXXXXXXXXX'; var campaign = 'Test'; var mobile_numbers = 'XXXXXXXXXX,XXXXXXXXXX'; var message = 'Testing message'; var message_type = '0'; var route_type = '0'; var schedule_date = ''; var is_flash = ''; var postData = new { dlt_template_id = dlt_template_id, campaign = campaign, mobile_numbers = mobile_numbers, message = message, message_type = message_type, route_type = route_type, schedule_date = schedule_date, is_flash = is_flash }; var jsonObject = JsonConvert.SerializeObject(postData);
var client = new RestClient("https://www.oursms.in/api/send-message"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddHeader("Authorization", "Bearer AppKey-
AppSecret"); request.AddParameter("application/json", JsonObject, ParameterType.RequestBody); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
Response
{ "status": true, "data": { "token": "1352c520-6c3f-11eb-bd22-27e6de38b331" }, "message": "message successfully sent.", "errors": [] }
Highlight the report of SMS which had been sent.
var client = new RestClient("http://localhost:8000/api/send-report/80bc12b0-a7e5-11ea-931c-dd542dcae7c2"); client.Timeout = -1; var request = new RestRequest(Method.GET); request.AddHeader("Content-Type", "application/json"); request.AddHeader("Authorization", "Bearer AppKey-
AppSecret"); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
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.
var client = new RestClient("https://www.oursms.in/api/templates"); client.Timeout = -1; var request = new RestRequest(Method.GET); request.AddHeader("Content-Type", "application/json"); request.AddHeader("Authorization", "Bearer AppKey-
AppSecret"); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
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.
var client = new RestClient("https://www.oursms.in/api/campaign-list-pagination"); client.Timeout = -1; var request = new RestRequest(Method.GET); request.AddHeader("Content-Type", "application/json"); request.AddHeader("Authorization", "Bearer
AppKey-
AppSecret"); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
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.
var client = new RestClient("https://www.oursms.in/api/campaign-list"); client.Timeout = -1; var request = new RestRequest(Method.GET); request.AddHeader("Content-Type", "application/json"); request.AddHeader("Authorization", "Bearer
AppKey-
AppSecret"); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
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": [] }