Use of Alibaba big fish SMS platform (Java)
In the password retrieval text message verification project, you need to use a text message to verify the password. Because Alibaba big fish is fast and stable, you decided to use Alibaba big fish. The steps are as follows: 1. First, log on to the Alibaba big fish official website and register as a developer. (Http://www.alidayu.com /? Utm_content = m_2931? Utm_content = m_2931? Utm_content = m_2931? Utm_content = m_2931) 2. View Ali big fish API documentation (http://open.taobao.com/doc2/apiDetail? Spm = 0.0.0.0.D1PYJd & apiId = 25450) 3. Download the jar package of Ali big fish 4. Start the development Code as follows:
// URLString url = "http://gw.api.taobao.com/router/rest"; // become a developer, the system automatically generates String appkey = "23300902"; String secret = "24c5befb62bed7917bf139b7d39d251d" after the application is created "; // text message template content String json = "{\" code \ ": \" 1234 \ ", \" product \ ": \" E-Commerce verification \"}"; taobaoClient client = new DefaultTaobaoClient (url, appkey, secret); AlibabaAliqinFcSmsNumSendRequest req = new AlibabaAliqinFcSmsNumSendRequest (); req. setextends ("123456"); req. setSmsType ("normal"); req. setSmsFreeSignName ("Change Verification"); req. setSmsParamString (json); req. setRecNum (tel); req. setSmsTemplateCode ("SMS_4720619"); try {AlibabaAliqinFcSmsNumSendResponse rsp = client.exe cute (req); System. out. println (rsp. getBody (); return 1;} catch (Exception e) {// TODO: handle exceptionreturn-1 ;}
To borrow others' platforms, you must carefully look at the called APIs. This is an essential skill and a detour. It is easy to understand alicloud's API, but it is not completely detailed. If you do not know it, you can use Baidu on the Internet. You cannot ask others to write it in great detail. For rules customized by others, you only follow the rules, or you are the person who makes the rules.