Skip Navigation Links.
展开 最小化

SpreadWebServcie.CreateSubscription Method

It creates a subscription, or re-active a deleted subscription.

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.

Parameters

Parameter

Type

Description

loginEmail

String

The login email of your Spread account.

password

String

The password of your Spread account or API Key which you can retrieve from your Spread account (My account=> Settings).

subscriptionName

String

The name of subscription to be created.

description

String

The description of subscription to be created.

Return Value

Boolean or Exception. If it success, it will return True, otherwise it will return False or Exception.

Please find the details for the return message in the following table.

Status/Situation

Retrun Type

Retrun Message

Success

Boolean

True

If you input the error account or API Key, you will get the message.

Exception

Return a exception with message 'Spreader Email and Password not match!'.

If you call the API with empty value of subscriptionName. Exception

Return a exception with message 'Please provide a subscription Name.'.

If you have created a subscription named the name and you call the API with this name again. Exception

Return a exception with message 'Subscription "SubscriptionName" already exist!'.

Other situations with error, e.g. timeout. Exception

Return a exception with error message.

It is failed to create a subscription. Boolean

False

Example

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.