Пример #1
0
        /// <summary>
        /// 获取流量产品列表
        /// </summary>
        /// <returns></returns>
        public static string GetFlowProductList()
        {
            SortedDictionary <string, string> parameters = new SortedDictionary <string, string>();

            parameters.Add("app_key", APP_KEY);
            parameters.Add("method", "cn.etuo.cloud.api.flow.list");
            parameters.Add("sign", GetSign(parameters));
            return(HttpClientV2.HttpPost(url, parameters));
        }
Пример #2
0
        /// <summary>
        /// 充值流量
        /// </summary>
        /// <param name="to">手机号</param>
        /// <param name="flowcode">流量产品编码</param>
        /// <param name="out_trade_no">商户订单号,可空</param>
        /// <returns></returns>
        private static string RechargeFlow(string to, string flowcode, string out_trade_no)
        {
            SortedDictionary <string, string> parameters = new SortedDictionary <string, string>();

            parameters.Add("app_key", APP_KEY);
            parameters.Add("method", "cn.etuo.cloud.api.flow.charge");
            parameters.Add("out_trade_no", out_trade_no);
            parameters.Add("mobile", to);
            parameters.Add("flowcode", flowcode);
            parameters.Add("sign", GetSign(parameters));
            return(HttpClientV2.HttpPost(url, parameters));
        }
Пример #3
0
        /// <summary>
        /// 发送语音通知
        /// </summary>
        /// <param name="to">接收语音通知的手机号</param>
        /// <param name="template">语音通知模板ID</param>
        /// <returns></returns>
        public static string SendVoiceNotice(string to, int template)
        {
            SortedDictionary <string, string> parameters = new SortedDictionary <string, string>();

            parameters.Add("app_key", APP_KEY);
            parameters.Add("method", "cn.etuo.cloud.api.voice.message");
            parameters.Add("out_trade_no", "");//商户订单号,可空
            parameters.Add("to", to);
            parameters.Add("template", template.ToString());
            parameters.Add("sign", GetSign(parameters));
            return(HttpClientV2.HttpPost(url, parameters));
        }
Пример #4
0
        /// <summary>
        /// 发送自定义短信
        /// </summary>
        /// <param name="to">手机号</param>
        /// <param name="content">短信内容</param>
        /// <param name="out_trade_no">商户订单号,可空</param>
        /// <returns></returns>
        public static string SendText(string to, string content, string out_trade_no)
        {
            SortedDictionary <string, string> parameters = new SortedDictionary <string, string>();

            parameters.Add("app_key", APP_KEY);
            parameters.Add("view", FORMAT);
            parameters.Add("method", "cn.etuo.cloud.api.sms.advance");
            parameters.Add("out_trade_no", out_trade_no);
            parameters.Add("to", to);
            parameters.Add("content", content);
            parameters.Add("sign", GetSign(parameters));
            return(HttpClientV2.HttpPost(url, parameters));
        }
Пример #5
0
        /// <summary>
        /// 发生模板短信
        /// </summary>
        /// <param name="to">手机号</param>
        /// <param name="template">短信模板ID</param>
        /// <param name="param">模板中的参数,以英文逗号分隔</param>
        /// <returns></returns>
        public static string SendSmsTpl(string to, int template, string param)
        {
            SortedDictionary <string, string> parameters = new SortedDictionary <string, string>();

            parameters.Add("app_key", APP_KEY);
            parameters.Add("view", FORMAT);
            parameters.Add("method", "cn.etuo.cloud.api.sms.template");
            parameters.Add("out_trade_no", "");//商户订单号,可空
            parameters.Add("to", to);
            parameters.Add("template", template.ToString());
            parameters.Add("params", param);
            parameters.Add("sign", GetSign(parameters));
            return(HttpClientV2.HttpPost(url, parameters));
        }