public ResponseWrapper sendMessages(SMSPayload payload) { Preconditions.checkArgument(payload != null, "pushPayload should not be empty"); payload.Check(); String payloadJson = payload.ToJson(payload); return sendMessages(payloadJson); }
public ResponseWrapper sendMessages(SMSPayload payload) { Preconditions.checkArgument(payload != null, "pushPayload should not be empty"); payload.Check(); String payloadJson = payload.ToJson(payload); return(sendMessages(payloadJson)); }
public string ToJson(SMSPayload sms) { return(JsonConvert.SerializeObject(sms, Newtonsoft.Json.Formatting.None, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore })); }
public string ToJson(SMSPayload 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 SMSPayload codes = new SMSPayload("134888888888", 1); String codesjson = codes.ToJson(codes); Console.WriteLine(codesjson); ResponseWrapper result= client._SMSClient.sendCodes(codesjson); Console.WriteLine("result.responseContent"); Console.WriteLine(result.responseContent); Console.ReadLine(); }
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_3 Dictionary<string, string> temp_para= new Dictionary<string, string>(); ; temp_para.Add("codes", "1914"); string para = temp_para.ToString(); Console.WriteLine(para); SMSPayload codes = new SMSPayload("134888888888", 9890, temp_para); String codesjson = codes.ToJson(codes); Console.WriteLine(codesjson); client._SMSClient.sendMessages(codesjson); Console.ReadLine(); }