Skip Navigation Links.
展开 最小化

SpreadWebServcie.GetCampaignOpens Method

下面的例子演示 如何獲取指定時間段內活動的開啓記錄.

參數

參數

類型

描述

loginEmail

String

Spread賬號的登陸郵箱.

password

String

Spread賬號的密碼或者API Key.

campaignId

String

活動的ID.

startDate

DateTime

報告的起始時間.

endDate

DateTime

報告的截止時間.

返回結果

Dataset 包含一個單表,行: subscriber_email, email_opening_time, country, city, browser, device, language, sending_status_time, creative_id, RowNumber

例子

string loginName = "Spread@reasonables.com";
string loginPassword = "Spread";

int campaignID = 12345;
// suggest dateTime string format "yyyy-MM-ddTHH:mm:ss" ,such as "2023-02-06T12:11:21" .
DateTime startTime = DateTime.Parse("2023-02-06T12:11:21");
DateTime endTime = DateTime.Parse("2023-02-07T12:11:21");

//Create a SpreadWebService object and use its method.
SpreadWebService MySpread = new SpreadWebService();
DataSet result = MySpread.GetCampaignOpens(loginName, loginPassword, campaignID, startTime, endTime);

Dim loginName As String = "Spread@reasonables.com"
Dim loginPassword As String = "Spread"

Dim campaignID As Integer = 123456
' suggest dateTime string format "yyyy-MM-ddTHH:mm:ss" ,such as "2023-02-06T12:11:21" .
Dim startTime As DateTime = "2023-02-06T12:11:21"
Dim endTime As DateTime = "2023-02-07T12:11:21"

'Create a SpreadWebService object and use its method.
Dim MySpread As New SpreadWebService
Dim result As DataSet = MySpread.GetCampaignOpens(loginName, loginPassword, campaignID, startTime, endTime)

  /**
    * @name     GetCampaignOpens
    * @function Get open report in a period of time for a campaign
    * @param
    *  loginEmail        The login email of your Spread account.
    *  password 	 The login password of your Spread account.
    *  campaignID        The id of  campaign.
    *  startDate         Start time.
    *  endDate           End time.
    *  @return
    *  		dataset.
    *  Dataset Columns:
	 subscriber_email, isSuccess,sending_status_time
    */
    public function GetCampaignOpens($loginEmail,$password,$campaignID,$startDate,$endDate){
        $paraArray = array(
	            'loginEmail' 	 	=> $loginEmail,
	            'password'     	 	=> $password,
		    'campaignID'     	        => $campaignID,
		    'startDate'     	        => $startDate,
		    'endDate'                   => $endDate
        );
        $Client = new SoapClient("http://service.rspread.com/Service.asmx?WSDL");
        Return $Client -> GetCampaignOpens( $paraArray );
    }
         
No sample.