Skip Navigation Links.
展开 最小化

SpreadWebServcie.DeleteSubscription Method

Delete the Subscription and remove all subscribers from this list.

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.

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 exception with message 'Spreader Email and Password not match!'.

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

Return exception with message 'Invalid subscription Id.'.

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

Return a exception with error message.

It is failed to delete the subscription. Integer

False

Example

string loginEmail = "Spread@reasonables.com";

string loginPassword = "Spread";

string subscriptionName = "Spread Subscription Name";

SpreadAPI. SpreadWebService MySpread = new SpreadAPI. SpreadWebService ();

bool result = MySpread.DeleteSubscription(loginEmail, loginPassword, subscriptionName);

Dim loginEmail As String = "Spread@reasonables.com"

Dim loginPassword As String = "Spread"

Dim subscriptionName As String = "Spread Subscription Name"

Dim MySpread As New SpreadAPI. SpreadWebService

Dim result As Boolean = MySpread.DeleteSubscription(loginEmail, loginPassword, subscriptionName)

    /**
    * @name     deleteSubscription
    * @function delete the subscription
    * @param
    *  subscriptionName	the subscription Name you want to delete as subscriptionName
    * @return
    *  error message       failed.
    *  1        success.
    */
    public function deleteSubscription($loginEmail,$password,$subscriptionName){
        $sendArr = array(
	        'loginEmail'        => $loginEmail,
	        'password'	    => $password,
	        'subscriptionName'  => $subscriptionName
        );
        $Client=new SoapClient("http://service.rspread.com/Service.asmx?WSDL");
        $flag = $Client -> DeleteSubscription( $sendArr );
        if( empty( $flag ) ){
	        return 0;
        }
        return 1;
    }

         
No sample.