第三方短信验证码接口

youfather 发布于 2016/05/11 10:56
阅读 7K+
收藏 1
PHP
哪位做过短信验证码接口的,有没有什么好的资源,推荐一下,谢谢!
加载中
1
潇湘双雁
潇湘双雁
这是一个大鱼的信息验证接口   http://addon.discuz.com/?@micxp_message.plugin。好处是便宜。一条4分5.新用户还用60块。
0
一片无助的云
刚接了luosimao的, 接口调试起来很简单。https://luosimao.com/docs/api/
youfather
youfather
还没用过,看起来还可以
w麦麦
w麦麦
谢谢推荐,刚充值了在用 ,真的很不错
0
智网科技-验证码
智网科技-验证码
找我吧,一手资源通道,直接与三大运营商对接
0
树上有云c
流程是运营商——服务商(短信平台)——企业用户,实现方式是服务商从运营商那里拿通道,然后服务商跟企业客户对接实现短信的发送,代码也有很多我给你找一个,直接拿的我们以前的合作商,阅信的,不知道更新了没,应该可以实现。地址:http://www.jinloushiji.cn


------------------------------------------------------------------------------------------------------------------


短信发送


//接口地址


String url = "http://183.203.28.5:9000/HttpSmsMt";


//下发时间


String mttime = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());


Map<String, String> param = new HashMap<String, String>();


param.put("name", "用户帐号");


param.put("pwd", Tools.MD5("用户密码"+mttime));


param.put("content", URLEncoder.encode("【阅信短信验证码】验证码888888,打死也不能告诉别人哦。", "UTF-8"));


param.put("phone", "13400000000");


param.put("subid", "");


param.put("mttime", mttime);


HttpTool.sendPost(url, param);


POST提交方法


public static String sendPost(String url, Map<String, String> params) {


Log.i("POST提交:[url="+url+"]"+params.toString());


URL u = null;


HttpURLConnection con = null;


// 构建请求参数


StringBuffer sb = new StringBuffer();


if (params != null) {


for (Entry<String, String> e : params.entrySet()) {


sb.append(e.getKey()).append("=").append(e.getValue()).append("&");


}


sb.substring(0, sb.length() - 1);


}


// 尝试发送请求


try {


u = new URL(url);


con = (HttpURLConnection) u.openConnection();


con.setRequestMethod("POST");


con.setConnectTimeout(6000);


con.setDoOutput(true);


con.setDoInput(true);


con.setUseCaches(false);


con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");


OutputStreamWriter osw = new OutputStreamWriter(con.getOutputStream(), "UTF-8");


osw.write(sb.toString());


osw.flush();


osw.close();


} catch (Exception e) {


Log.e(e);


} finally {


if (con != null) {


con.disconnect();


}


}


// 读取返回内容


StringBuffer buffer = new StringBuffer();


try {


BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));


String temp;


while ((temp = br.readLine()) != null) {


buffer.append(temp).append("\n");


}


} catch (Exception e) {


Log.e(e);


}


Log.i("POST响应:"+buffer.toString());


return buffer.toString();


}


MD5加密方法


public static String MD5(String str){


MessageDigest md5 = null;  


    try{  


        md5 = MessageDigest.getInstance("MD5");  


    }catch (Exception e){  


        Log.i(e.getMessage());


        return "";  


    }  


    char[] charArray = str.toCharArray();  


    byte[] byteArray = new byte[charArray.length];  


    for (int i = 0; i < charArray.length; i++)  


        byteArray[i] = (byte) charArray[i];  


    byte[] md5Bytes = md5.digest(byteArray);  


    StringBuffer hexValue = new StringBuffer();  


    for (int i = 0; i < md5Bytes.length; i++){  


        int val = ((int) md5Bytes[i]) & 0xff;  


        if (val < 16){


            hexValue.append("0");


        }


        hexValue.append(Integer.toHexString(val));  


    }  


    return hexValue.toString();  


}


?


?
0
树上有云c

阅信短信验证码平台是直连运营商的合作伙伴。

 给你一个阅信短信平台c#的示例代码,别的可以找他们的商务要。

using System; 

using System.Collections.Generic; 

using System.Linq; 

using System.Text; 

using System.Net.Security; 

using System.Security.Cryptography.X509Certificates; 

using System.Net; 

using System.IO; 

using System.IO.Compression; 

using System.Text.RegularExpressions;

using System.Security.Cryptography;

using System.Web;

public class Test

{

        private static readonly string DefaultUserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"; 

 

        private static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) 

        { 

            return true; //总是接受    

        } 

        static void Main(string[] args) 

        { 

            DateTime dt = DateTime.Now;

            string mttime = dt.ToString("yyyyMMddHHmmss");

            string pwd1 = "*************"+mttime;

      string pwd = GetMD5(pwd1)

            string content = "【金楼世纪】验证码888888,打死也不能告诉别人哦。";

            string url = "http://183.203.28.226:9000/HttpSmsMt"; 

            Encoding encoding = Encoding.GetEncoding("utf-8"); 

            IDictionary<string, string> parameters = new Dictionary<string, string>(); 

            parameters.Add("name", "****"); 

            parameters.Add("pwd", pwd); 

            parameters.Add("content",content);

            parameters.Add("phone","13381272353");

            parameters.Add("subid","");

            parameters.Add("mttime", mttime); 

            HttpWebResponse response = CreatePostHttpResponse(url,parameters,encoding); 

            //打印返回值 

            Stream stream = response.GetResponseStream();   //获取响应的字符串流 

            StreamReader sr = new StreamReader(stream); //创建一个stream读取流 

            string html = sr.ReadToEnd();   //从头读到尾,放到字符串html 

            Console.WriteLine(html);  

        }

            public static string GetMD5(string myString) 

        {

            MD5 md5 = new MD5CryptoServiceProvider();

           // byte[] fromData = System.Web.HttpUtility.UrlEncode.GetBytes(myString);

            byte[] fromData = Encoding.Default.GetBytes(myString);

            byte[] targetData = md5.ComputeHash(fromData);

            string byte2String = null;

            for(int i=0;i<targetData.Length;i++) 

            {

                byte2String+= targetData[i].ToString("x");

            }

            return byte2String;

        }

            public static HttpWebResponse CreatePostHttpResponse(string url, IDictionary<string, string> parameters,Encoding charset) 

        { 

            HttpWebRequest request = null; 

            //HTTPSQ请求 

            ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult); 

            request = WebRequest.Create(url) as HttpWebRequest; 

            request.ProtocolVersion = HttpVersion.Version10; 

            request.Method = "POST"; 

            request.ContentType = "application/x-www-form-urlencoded"; 

            request.UserAgent = DefaultUserAgent; 

            //如果需要POST数据    

            if (!(parameters == null || parameters.Count == 0)) 

            { 

                StringBuilder buffer = new StringBuilder(); 

                int i = 0; 

                foreach (string key in parameters.Keys) 

                { 

                    if (i > 0) 

                    { 

                        buffer.AppendFormat("&{0}={1}", key, parameters[key]); 

                    } 

                    else 

                    { 

                        buffer.AppendFormat("{0}={1}", key, parameters[key]); 

                    } 

                    i++; 

                } 

                byte[] data = charset.GetBytes(buffer.ToString()); 

                using (Stream stream = request.GetRequestStream()) 

                { 

                    stream.Write(data, 0, data.Length); 

                } 

            } 

            return request.GetResponse() as HttpWebResponse; 

        }

}

0
安贞聂耳

秒信云这个平台做短信接口很好,服务好还便宜,可以试试http://www.miaoxinyun.com/file_interface.jsp


0
千古15
千古15
卡洛思短信平台 6年多的资历,资质都齐全正规,服务也很好,值得考虑。www.karlos.com.cn
0
麦田守望者1122
麦田守望者1122
短信验证码接口试一下北京硕达通,验证码5秒,三网合一,单价4分,到达率99.9%,api接口15分钟轻松对接,
0
送-送
中国移动云信 http://www.sms.cn
0
j
jlj224
http://submail.cn/ 这个是我们用的,简单方便,按部就班操作就行了,有问题工单反馈回复很快。名字叫submail,中文名叫赛邮。
返回顶部
顶部