Skip Navigation Links.
展开 最小化

SpreadWebServcie.CreateSubscription Method

创建一个联系人名单,或重新激活一个已删除的联系人。

public bool createSubscription (

string loginEmail,

string password,

string subscriptionName,

string description,

)

Public function createSubscription( _

loginEmail As String, _

password As String, _

subscriptionName As String, _

description As String _

) As Boolean

No sample for PHP.
No sample.

参数

参数

类型

描述

loginEmail

String

Spread账号邮件地址.

password

String

Spread账号的登录密码或者 API Key.

subscriptionName

String

被创建联系人名单的名称.

description

String

被创建联系人名单的描述.

返回结果

Boolean 或者 Exception. 如果创建成功,则返回True;否则,返回False或者抛出一个异常(Exception)。

请在下列表格中找到详细的返回信息:

状态/场景

返回类型

返回信息

成功创建联系人名单

Boolean

True

输入错误的账号或者API Key

Exception

抛出一个异常含有信息 'Spreader Email and Password not match!'.

未填写subscriptionName的值 Exception

抛出一个异常含有信息 'Please provide a subscription Name.'.

账号内已经有一个联系人名单使用该名字,请求API创建联系人名单时仍用该名字。 Exception

抛出一个异常含有信息 'Subscription "SubscriptionName" already exist!'.

其他错误情况,比如超时。 Exception

抛出一个异常含错误信息。

创建联系人名单失败 Boolean

False

例子

string loginName = "spread@reasonables.com";

string loginPassword = "TEST0000-TEST-0000-TEST-0000TEST0000";

string myNewSubsciption = "NoClone VIP";

string myNewDiscription = "NoClone VIPs are added to here.";

bool isSuccessful;

 

//Create a SpreadWebService object and use its method.

SpreadWebService MySpread = new SpreadWebService();

 

isSuccessful = MySpread.createSubscription (loginName, loginPassword, subscriptionName, description);

Dim loginName As String = "spread@reasonables.com"

Dim loginPassword As String = "TEST0000-TEST-0000-TEST-0000TEST0000"

Dim myNewSubsciption As String = "NoClone VIP"

Dim myNewDiscription As String = "NoClone VIPs are added to here."

Dim isSuccessful As Boolean

 

'Create a SpreadWebService object and use its method.

Dim MySpread As New SpreadWebService

 

isSuccessful = MySpread.createSubscription(loginName, loginPassword, _ subscriptionName, description)

      /**
     * @name     createList
     * @function create sending list
     * @param
     *  ListName	name of sending list
     *  ListDes		description of sending list
     * @return
	 *	-1       failed to create sending list
     */
    public function createList($loginEmail,$password,$listName,$listDes ){
        $ListArr = array(
            'loginEmail'        => $loginEmail,
            'password'          => $password,
            'subscriptionName'  => $listName,
            'description'       => $listDes
        );
        $Client=new SoapClient("http://service.rspread.com/Service.asmx?WSDL");
        $isSuccessful = $Client -> createSubscription( $ListArr );
        if( empty( $isSuccessful ) ){
            return -1;
        }
        return 0;
    }
         
No sample.