简体   繁体   English

使用API​​发送短信

[英]Sending SMS using API

I contacted my SMS company and asked them about API to send SMS by programming language. 我联系了我的SMS公司,并询问了有关API的信息,以便通过编程语言发送SMS。
they send the following code, but i didn't know how to use it in my vb.net application: 他们发送以下代码,但我不知道如何在vb.net应用程序中使用它:

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. 研究如何在vb.net应用程序中使用REST Web服务。

  • 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",) (“收据编号”:“ 05xxxxxx; 05xxxxxx”,)

Do not use this provider API because it's not safe. 不要使用此提供程序API,因为它不安全。 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. 根据您的样本,我可以推断出它们没有使用SSL / TLS进行API调用,并且您的密码很容易被计算机和服务器之间的任何人窃取。 Ask their support for a safer way of communicating. 向他们的支持寻求更安全的沟通方式。

Or you can look at our API which is also HTTP REST API. 或者,您可以查看我们的API ,它也是HTTP REST API。 You can study how to send HTTP requests with JSON payload from VB.NET over here . 您可以在此处研究如何从VB.NET发送带有JSON负载的HTTP请求。

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: 然后检查批量短信API调用 ,它是紧凑的形式,可以发送许多这样的短信:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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