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.