2022年JAVA短信加语音组合方案API

在一些重要信息通知的场景,需要用户能收到且关注到信息,采用短信+语音通知同步推送的方式,能很好的解决这个问题。

场景一:相同内容的短信通知+语音通知同步发送

在推送短信的同时,同步推送相同内容的语音通知;用户在手机上收到通知内容后,还可以通过查阅短信来确认信息内容。

[En]

While pushing the short message, the voice notification of the same content is pushed synchronously; after the user receives the notification content on the phone, the user can also confirm the information content by consulting the short message.

适用领域:

货运司机通知、快递物流通知、物联网设备预警通知、服务器监控预警通知、重要订单信息变更通知。

[En]

Freight driver notification, express logistics notification, Internet of things equipment early warning notification, server monitoring early warning notification, important order information change notice.

通知模板示例:

【互亿无线】尊敬的***用户,您好,您的可用余额为6358条,请及时续费,自助续费请登录用户中心操作!

【互亿无线】尊敬的***用户,您好,您的账户已达您设置的最大发送量,系统已暂停发送,如需变更,请登录用户中心操作!

石化】您的车号,请于**前入厂,请正确穿戴安全帽、反光马甲,听从现场人员指挥,谢谢配合!

2022年JAVA短信加语音组合方案API

短信通知+语音播报自动双呼接口,详情请查看短信通知+语音播报自动双呼解决方案

JAVA对接验证码短信接口DEMO示例 本文为您提供了JAVA语言版本的验证码短信接口对接DEMO示例

  • 接口类型:触发短信接口,支持发送验证码短信、订单通知短信、节日祝福等。
    [En]

    API type: triggers SMS API, supports sending verification code SMS, order notification SMS, holiday blessing, etc.*

  • 账户注册:请通过该地址开通账户 http://user.ihuyi.com/?exClaO

  • 注意事项:
    (1)调试期间,请使用用系统默认的短信内容:您的验证码是:【变量】。请不要把验证码泄露给其他人。
    (2)请使用 用户名 及 APIkey来调用接口,APIkey在会员中心可以获取;
    *(3)该代码仅供接入短信接口参考使用,客户可根据实际需要自行编写

import java.io.IOException;

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.methods.PostMethod;

import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;

import util.StringUtil;

public class sendsms {

    private static String Url = "http://106.ihuyi.com/webservice/sms.php?method=Submit";

    public static void main(String [] args) {

        HttpClient client = new HttpClient();
        PostMethod method = new PostMethod(Url);

        client.getParams().setContentCharset("GBK");
        method.setRequestHeader("ContentType","application/x-www-form-urlencoded;charset=GBK");

        int mobile_code = (int)((Math.random()*9+1)*100000);

        String content = new String("您的验证码是:" + mobile_code + "。请不要把验证码泄露给其他人。");

        NameValuePair[] data = {//提交短信
                new NameValuePair("account", "用户名"), //查看用户名 登录用户中心->验证码通知短信>产品总览->API接口信息->APIID
                new NameValuePair("password", "密码"), //查看密码 登录用户中心->验证码通知短信>产品总览->API接口信息->APIKEY
                //new NameValuePair("password", util.StringUtil.MD5Encode("密码")),
                new NameValuePair("mobile", "手机号码"),
                new NameValuePair("content", content),
        };
        method.setRequestBody(data);

        try {
            client.executeMethod(method);

            String SubmitResult =method.getResponseBodyAsString();

            //System.out.println(SubmitResult);

            Document doc = DocumentHelper.parseText(SubmitResult);
            Element root = doc.getRootElement();

            String code = root.elementText("code");
            String msg = root.elementText("msg");
            String smsid = root.elementText("smsid");

            System.out.println(code);
            System.out.println(msg);
            System.out.println(smsid);

             if("2".equals(code)){
                System.out.println("短信提交成功");
            }

        } catch (HttpException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (DocumentException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

    }

Original: https://blog.csdn.net/m0_61684517/article/details/123258100
Author: 苍穹破天
Title: 2022年JAVA短信加语音组合方案API

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/498074/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球