21,873
社区成员




https://sendcloud.sohu.com/webapi/list.create.json
* 请求接口(建议使用post请求,注意不要使用multipart-post):
/list.create
* 参数说明:
参数 类型 是否必须 说明 描述
api_user string 是 请求SC认证账号
api_key string 是 请求 SC认证密码
addres sstring 是 列表别称地址 例如:developers@sendcloud.org或者 Developers
name string 是 列表名称 不能大于16个中文字
description string 否 列表描述 不能大于85个中文字符
curl -d "api_user=*&api_key=*&address=runnerleer@maillist.sendcloud.org&name=demo&description=this is a demo list" https://sendcloud.sohu.com/webapi/list.create.json
<form method="post" action="https://sendcloud.sohu.com/webapi/list.create.json">
<input type="text" name="api_user" value="×" /><br />
<input type="text" name="api_key" value="×" /><br />
<input type="text" name="address" value="runnerlee@maillit.sendcloud.org" /><br />
<input type="text" name="name" value="Abao建立的测试邮件列表" /><br />
<input type="text" name="description" value="这是Abao建立的一个测试邮件列表" /><br />
<input type="submit" value="submit" />
</form>
<?php
header('Content-Type:text/html;charset=utf-8');
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_URL, 'https://sendcloud.sohu.com/webapi/list.create.json');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = array(
'api_user' => '*',
'api_key' => '*',
'address' => 'runnerlee@maillist.sendcloud.org',
'name' => 'Abao新建的测试邮件列表',
'description' => '这是Abao新建的测试邮件列表',
);
curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
if(false === $result=curl_exec($ch)) {
echo 'false:<br />';
}
var_dump(json_decode($result,true));
curl_close($ch);
Notice: curl_setopt(): CURLOPT_SSL_VERIFYHOST no longer accepts the value 1, value 2 will be used instead in F:\www\sendCloud\demo.php on line 13