示例#1
0
 public ResponseWrapper sendVoice_codes(Voice_codesPayload payload)
 {
     Preconditions.checkArgument(payload != null, "pushPayload should not be empty");
     payload.Check();
     String payloadJson = payload.ToJson(payload);
     return sendVoice_codes(payloadJson);
 }
        public ResponseWrapper sendVoice_codes(Voice_codesPayload payload)
        {
            Preconditions.checkArgument(payload != null, "pushPayload should not be empty");
            payload.Check();
            String payloadJson = payload.ToJson(payload);

            return(sendVoice_codes(payloadJson));
        }
示例#3
0
 public string ToJson(Voice_codesPayload sms)
 {
     return(JsonConvert.SerializeObject(sms,
                                        Newtonsoft.Json.Formatting.None,
                                        new JsonSerializerSettings
     {
         NullValueHandling = NullValueHandling.Ignore
     }));
 }
 public string ToJson(Voice_codesPayload sms)
 {
     return JsonConvert.SerializeObject(sms,
                     Newtonsoft.Json.Formatting.None,
                     new JsonSerializerSettings
                     {
                         NullValueHandling = NullValueHandling.Ignore
                     });
 }
        public static void Main(string[] args)
        {
            Console.WriteLine("*****开始发送******");

            JSMSClient client = new JSMSClient(app_key, master_secret);

            // 语音短信验证码 API
            // API文档地址 http://docs.jiguang.cn/jsms/server/rest_api_jsms/#api_1

            Voice_codesPayload voice_codes = new Voice_codesPayload("134888888888", 60);
            String voice_codesjson = voice_codes.ToJson(voice_codes);
            Console.WriteLine(voice_codesjson);
            client._SMSClient.sendVoice_codes(voice_codesjson);

            Console.ReadLine();
        }