本代码示例是基于C#的六派数据接口进行数据请求 API服务请求的代码示例,使用前你需要:
①:通过https://www.6api.net/api/sms/ 申请API服务
以下是完整代码示例:
class Response
{
public string statusCode;
}
static void Main(string[] args)
{
string method = "POST";
string url = "http://open.liupai.net/sms/send";
Dictionary<string, string> param = new Dictionary<string, string>();
param.Add("appkey", "yourappsecret");
param.Add("mobile", "参数1");//手机号(不支持群发)
param.Add("content", "参数2");//发送内容 模板必须是审核通过的。
param.Add("templateid", "参数3");//模版ID
Dictionary<string, string> headers = null;
string result = api_send_request(method, url, param, headers);
if (result == "")
{
//返回内容异常,发送请求失败
Console.WriteLine("发送请求失败");
return;
}
Response res = new JavaScriptSerializer().Deserialize<Response>(result);
if (res.statusCode == "200") //有个别接口计费状态码为其他;请注意甄别
{
//状态码为200, 说明请求成功
Console.WriteLine(string.Format("请求成功: {0}", result));
}
else
{
//状态码非200, 说明请求失败
Console.WriteLine(string.Format("请求失败: {0}", result));
}
Console.ReadLine();
}
本代码示例是基于C#的六派数据接口进行数据请求 API服务请求的代码示例,使用前你需要:
①:通过https://www.6api.net/api/sms/ 申请API服务
以下是完整代码示例:
class Response
{
public string statusCode;
}
static void Main(string[] args)
{
string method = "POST";
string url = "http://open.liupai.net/sms/balance";
Dictionary<string, string> param = new Dictionary<string, string>();
param.Add("appkey", "yourappsecret");
Dictionary<string, string> headers = null;
string result = api_send_request(method, url, param, headers);
if (result == "")
{
//返回内容异常,发送请求失败
Console.WriteLine("发送请求失败");
return;
}
Response res = new JavaScriptSerializer().Deserialize<Response>(result);
if (res.statusCode == "200") //有个别接口计费状态码为其他;请注意甄别
{
//状态码为200, 说明请求成功
Console.WriteLine(string.Format("请求成功: {0}", result));
}
else
{
//状态码非200, 说明请求失败
Console.WriteLine(string.Format("请求失败: {0}", result));
}
Console.ReadLine();
}
本代码示例是基于C#的六派数据接口进行数据请求 API服务请求的代码示例,使用前你需要:
①:通过https://www.6api.net/api/sms/ 申请API服务
以下是完整代码示例:
class Response
{
public string statusCode;
}
static void Main(string[] args)
{
string method = "POST";
string url = "http://open.liupai.net/sms/addaccount";
Dictionary<string, string> param = new Dictionary<string, string>();
param.Add("appkey", "yourappsecret");
param.Add("company", "参数1");//企业全称
param.Add("signature", "参数2");//签名 格式【XXX】
param.Add("statusurl", "参数3");//状态报告回送地址
param.Add("replyurl", "参数4");//短信回送地址
param.Add("replyusername", "参数5");//回送用户名
param.Add("replypassword", "参数6");//回送密码
param.Add("totalnum", "100");//分配的次数
Dictionary<string, string> headers = null;
string result = api_send_request(method, url, param, headers);
if (result == "")
{
//返回内容异常,发送请求失败
Console.WriteLine("发送请求失败");
return;
}
Response res = new JavaScriptSerializer().Deserialize<Response>(result);
if (res.statusCode == "200") //有个别接口计费状态码为其他;请注意甄别
{
//状态码为200, 说明请求成功
Console.WriteLine(string.Format("请求成功: {0}", result));
}
else
{
//状态码非200, 说明请求失败
Console.WriteLine(string.Format("请求失败: {0}", result));
}
Console.ReadLine();
}
本代码示例是基于C#的六派数据接口进行数据请求 API服务请求的代码示例,使用前你需要:
①:通过https://www.6api.net/api/sms/ 申请API服务
以下是完整代码示例:
class Response
{
public string statusCode;
}
static void Main(string[] args)
{
string method = "POST";
string url = "http://open.liupai.net/sms/accountlist";
Dictionary<string, string> param = new Dictionary<string, string>();
param.Add("appkey", "yourappsecret");
param.Add("page", "参数1");//页码 默认为1
param.Add("pageSize", "参数2");//每页条数 默认为20
Dictionary<string, string> headers = null;
string result = api_send_request(method, url, param, headers);
if (result == "")
{
//返回内容异常,发送请求失败
Console.WriteLine("发送请求失败");
return;
}
Response res = new JavaScriptSerializer().Deserialize<Response>(result);
if (res.statusCode == "200") //有个别接口计费状态码为其他;请注意甄别
{
//状态码为200, 说明请求成功
Console.WriteLine(string.Format("请求成功: {0}", result));
}
else
{
//状态码非200, 说明请求失败
Console.WriteLine(string.Format("请求失败: {0}", result));
}
Console.ReadLine();
}
本代码示例是基于C#的六派数据接口进行数据请求 API服务请求的代码示例,使用前你需要:
①:通过https://www.6api.net/api/sms/ 申请API服务
以下是完整代码示例:
class Response
{
public string statusCode;
}
static void Main(string[] args)
{
string method = "POST";
string url = "http://open.liupai.net/sms/editaccount";
Dictionary<string, string> param = new Dictionary<string, string>();
param.Add("appkey", "yourappsecret");
param.Add("accountid", "参数1");//要修改的子账号ID
param.Add("company", "参数2");//企业全称
param.Add("signature", "参数3");//签名 格式【XXX】
param.Add("statusurl", "参数4");//状态报告回送地址
param.Add("replyurl", "参数5");//短信回送地址
param.Add("replyusername", "参数6");//回送用户名
param.Add("replypassword", "参数7");//回送密码
param.Add("totalnum", "参数8");//分配的次数
Dictionary<string, string> headers = null;
string result = api_send_request(method, url, param, headers);
if (result == "")
{
//返回内容异常,发送请求失败
Console.WriteLine("发送请求失败");
return;
}
Response res = new JavaScriptSerializer().Deserialize<Response>(result);
if (res.statusCode == "200") //有个别接口计费状态码为其他;请注意甄别
{
//状态码为200, 说明请求成功
Console.WriteLine(string.Format("请求成功: {0}", result));
}
else
{
//状态码非200, 说明请求失败
Console.WriteLine(string.Format("请求失败: {0}", result));
}
Console.ReadLine();
}
本代码示例是基于C#的六派数据接口进行数据请求 API服务请求的代码示例,使用前你需要:
①:通过https://www.6api.net/api/sms/ 申请API服务
以下是完整代码示例:
class Response
{
public string statusCode;
}
static void Main(string[] args)
{
string method = "POST";
string url = "http://open.liupai.net/sms/addtemplate";
Dictionary<string, string> param = new Dictionary<string, string>();
param.Add("appkey", "yourappsecret");
param.Add("accountid", "参数1");//子账号ID
param.Add("title", "参数2");//模板标识
param.Add("content", "参数3");//模板内容 营销短信加:回TD退订。替换的内容用@代替,70个字符为一条短信。
param.Add("ismarket", "参数4");//是否为营销短信 1为是,0为不是
Dictionary<string, string> headers = null;
string result = api_send_request(method, url, param, headers);
if (result == "")
{
//返回内容异常,发送请求失败
Console.WriteLine("发送请求失败");
return;
}
Response res = new JavaScriptSerializer().Deserialize<Response>(result);
if (res.statusCode == "200") //有个别接口计费状态码为其他;请注意甄别
{
//状态码为200, 说明请求成功
Console.WriteLine(string.Format("请求成功: {0}", result));
}
else
{
//状态码非200, 说明请求失败
Console.WriteLine(string.Format("请求失败: {0}", result));
}
Console.ReadLine();
}
本代码示例是基于C#的六派数据接口进行数据请求 API服务请求的代码示例,使用前你需要:
①:通过https://www.6api.net/api/sms/ 申请API服务
以下是完整代码示例:
class Response
{
public string statusCode;
}
static void Main(string[] args)
{
string method = "POST";
string url = "http://open.liupai.net/sms/templatelist";
Dictionary<string, string> param = new Dictionary<string, string>();
param.Add("appkey", "yourappsecret");
param.Add("accountid", "参数1");//子账号ID
param.Add("page", "参数2");//页码 默认为1
param.Add("pageSize", "参数3");//每页条数 默认为20
Dictionary<string, string> headers = null;
string result = api_send_request(method, url, param, headers);
if (result == "")
{
//返回内容异常,发送请求失败
Console.WriteLine("发送请求失败");
return;
}
Response res = new JavaScriptSerializer().Deserialize<Response>(result);
if (res.statusCode == "200") //有个别接口计费状态码为其他;请注意甄别
{
//状态码为200, 说明请求成功
Console.WriteLine(string.Format("请求成功: {0}", result));
}
else
{
//状态码非200, 说明请求失败
Console.WriteLine(string.Format("请求失败: {0}", result));
}
Console.ReadLine();
}
本代码示例是基于C#的六派数据接口进行数据请求 API服务请求的代码示例,使用前你需要:
①:通过https://www.6api.net/api/sms/ 申请API服务
以下是完整代码示例:
class Response
{
public string statusCode;
}
static void Main(string[] args)
{
string method = "POST";
string url = "http://open.liupai.net/sms/sendlogs";
Dictionary<string, string> param = new Dictionary<string, string>();
param.Add("appkey", "yourappsecret");
param.Add("templateid", "参数1");//短信模板ID
param.Add("date", "2022-06-17");//调取日期(天)
Dictionary<string, string> headers = null;
string result = api_send_request(method, url, param, headers);
if (result == "")
{
//返回内容异常,发送请求失败
Console.WriteLine("发送请求失败");
return;
}
Response res = new JavaScriptSerializer().Deserialize<Response>(result);
if (res.statusCode == "200") //有个别接口计费状态码为其他;请注意甄别
{
//状态码为200, 说明请求成功
Console.WriteLine(string.Format("请求成功: {0}", result));
}
else
{
//状态码非200, 说明请求失败
Console.WriteLine(string.Format("请求失败: {0}", result));
}
Console.ReadLine();
}