0

I contacted my SMS company and asked them about API to send SMS by programming language.
they send the following code, but i didn't know how to use it in my vb.net application:

By this method can send message to one contact or multi contacts Request:

POST http://api.yamamah.com/SendSMS
Host: api.yamamah.com
Content-Type: application/json
Body:
{
"Username": "",
"Password": "",
"Tagname": "",
"RecepientNumber": "05xxxxxx;05xxxxxx",
"VariableList": "",
"ReplacementList": "",
"Message": "test",
"SendDateTime": 0,
"EnableDR": False
}
Response
Status Code: 200
Content-Length: 70
Content-Type: application/json; charset=utf-8
Date: Sun, 26 Jan 2014 10:59:40 GMT
Returned message
{
"InvalidMSISDN": null,
"MessageID": "1d7d8d99-2da4-478a-8391-6783f467f479",
"Status": 1,  
"StatusDescription": "Success"
}
Ayden
  • 45
  • 11
  • Which part do you have problem with? This seems like a simple [Web Request](http://stackoverflow.com/a/4015346/2882256) with a json as body. Addtiionally: Ask your SMS provider for documentation or a simple example. – Alex B. Nov 15 '16 at 07:15
  • all of it, i can't convert this code to vb.net code! – Ayden Nov 15 '16 at 07:16
  • It´s not code. It´s a [post](https://en.wikipedia.org/wiki/POST_(HTTP)) request. – Alex B. Nov 15 '16 at 07:18
  • @AlexB. can you help me to translate that post to vb.net code? – Ayden Nov 15 '16 at 07:22
  • Lookout for a tutorial. And check @Gulrez answer. If you then have a specific programming problem come and ask again. – Alex B. Nov 15 '16 at 07:25

2 Answers2

0
  • Research how to consume a REST webservice in vb.net application.

  • Your SMS company has shared the below details

  • You can send the messages to multiple contacts as the Recepient Number is semicolon separated. ("RecepientNumber": "05xxxxxx;05xxxxxx",)

0

Do not use this provider API because it's not safe. Based on your sample, I can coclude that they're not using SSL/TLS for API calls and your password can be easily stolen by anyone between your computer and their server. Ask their support for a safer way of communicating.

Or you can look at our API which is also HTTP REST API. You can study how to send HTTP requests with JSON payload from VB.NET over here.

Then it might be useful to follow our tutorial on sending single sms.

And then check out bulk sms API call and it's compact form to send many sms like that:

POST https://api.wavecell.com/sms/v1/{subAccountId}/many/compact
Host: api.wavecell.com
Content-Type: application/json
Body:
{
  "destinations": [
    "6598760000",
    "+659870001",
    "tel+659870002",
    "+33(509)758-000"
  ],
  "template": {
    "source": "BRAND",
    "text": "Your message for all clients"
  }
}
astef
  • 8,575
  • 4
  • 56
  • 95