简体   繁体   中英

Sending SMS using API

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"
}
  • 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",)

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"
  }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM