如何使用VB.NET使用sms api [英] How to use sms api using VB.NET
问题描述
你好所有
我是vb的新手,我需要知道如何使用api发送短信
有短信公司api
--------------------
Post-Json API
发单或多个手机号码
立即发送或安排您的信息
发送英语或阿拉伯语或Unicode内容
手机号码智能过滤器
您的帐户面板内的完整报告
智能回复代码
参数:
用户名= MAX
密码= abc
语言= 1:对于英语2:对于阿拉伯语3:对于Unicode
sender =您注册并激活的SenderID
Mobile = 2011XXXXXX,2012XXXXX,2010XXXXX,......
message =选择芯片时触发此方法。
DelayUntil =用于调度格式: yyyy-mm-dd-HH-mm Ex。 2017-09-13-13-30
链接:
发布方法:https://smsmisr.com/api/webapi/ ?username = XXX& password = XXX& language = 1& sender = XXX& mobile = 2012XXXXXXX,2012XXX XXXX,& message = XXX& DelayUntil = 2017-09-13-13-30
我可以获得代码帮助
我尝试过:
i尝试
hello all
iam new on vb and i need to know how to send sms using api
there is sms company api
--------------------
Post-Json API
Send single or multiple mobile numbers
Send immediately or schedule your messages
Send in English or Arabic or Unicode contents
Smart filter for mobile numbers
Full report inside your account panel
Smart response codes
Parameters:
Username=MAX
password=abc
language= 1: For English 2: For Arabic 3: For Unicode
sender= Your Registered And Activated SenderID
Mobile= 2011XXXXXX,2012XXXXX,2010XXXXX,……
message= this method is triggered when a chip is selected.
DelayUntil= For scheduling Format: yyyy-mm-dd-HH-mm Ex. 2017-09-13-13-30
link:
Post Method: https://smsmisr.com/api/webapi/?username=XXX&password=XXX&language=1&sender=XXX&mobile=2012XXXXXXX,2012XXX XXXX,&message=XXX&DelayUntil=2017-09-13-13-30
can i get help with code
What I have tried:
i tried
Dim request As HttpWebRequest
Dim response As HttpWebResponse = Nothing
Dim url As String
Dim senderid As String = "Company"
Dim password As String = "abc"
Dim host As String
Dim originator As String = "MAX"
Dim Mobile As String = "201021XXXXX"
Dim lang As String = "2"
Dim msg As String = "Api Test Msg"
Try
host = "https://smsmisr.com/api/webapi/?"
'originator = "3423434343"
'password = "234hj"
url = host + "username=" & HttpUtility.UrlEncode(UserName) _
& "&password=" + HttpUtility.UrlEncode(password) _
& "&language=" + HttpUtility.UrlEncode(lang) _
& "&Sender=" + HttpUtility.UrlEncode(senderid) _
& "&Mobile=" + HttpUtility.UrlEncode(Mobile) _
& "&message=" + HttpUtility.UrlEncode(msg) _
& "&DelayUntil=" + HttpUtility.UrlEncode("2018-08-29-07-16")
request = DirectCast(WebRequest.Create(url), HttpWebRequest)
response = DirectCast(request.GetResponse(), HttpWebResponse)
MessageBox.Show("Response: " & response.StatusDescription)
Catch ex As Exception
End Try
当执行代码响应没问题但是没有短信发送到移动
When Excute code Response is ok but no sms sent to mobile
推荐答案
在浏览器中运行api并且检查结果。
run the api in browser and check the result.
这篇关于如何使用VB.NET使用sms api的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!