Skip Navigation Links.
展开 最小化

SpreadWebServcie.UpdateCampaignStatus Method

Update Campaign Status.

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).

campaignID

Integer

The ID of Campaign.

campaignStatus

CampaignStatus

The status of campaign you want update to. If only the campaign is in "Sending" or "Waiting" can be updated to "Pause", Or in "Pause" can be updated to "Waiting".

Return Value

True - success.

False - fail.

Example

string loginEmail = "Spread@reasonables.com";

string loginPassword = "Spread";

int campaignID = 1;

campaignStatus campaignStatus = CampaignStatus.Pause;

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

bool result = MySpread.UpdateCampaignStatus(loginEmail, loginPassword, campaignID, campaignStatus);

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

Dim loginPassword As String = "Spread"

Dim campaignID As Integer = 1

Dim campaignStatus As String = CampaignStatus.Pause

Dim MySpread As New SpreadAPI. SpreadWebService

Dim result As Boolean = MySpread.UpdateCampaignStatus(loginEmail, loginPassword, campaignID, campaignStatus)

    /**
    * @name     updateCampaignStatus
    * @function update campaign status
    * @param
    *  campaignID	the campaign ID you want to update as campaignID
    * @return
    *  error message       failed.
    *  1        success.
    */
    public function updateCampaignStatus($loginEmail,$password,$campaignID,$campaignStatus ){
        $sendArr = array(
	        'loginEmail'        => $loginEmail,
	        'password'	    => $password,
	        'campaignID'       => $campaignID,
	        'campaignStatus'       => $campaignStatus
        );
        $Client=new SoapClient("http://service.rspread.com/Service.asmx?WSDL");
        $flag = $Client -> UpdateCampaignStatus( $sendArr );
        if( empty( $flag ) ){
	        return -1;
        }
        return 1;
    }

         
No sample.