GetAllCreditsFromSurveyBetween

Description

Gets all credits for a given survey in a panel to/from/between dates

Signature
PanelistCredit[] GetAllCreditsFromSurveyBetween(string key, string panelId, string surveyId, DateTime fromDate, DateTime toDate, DatabaseType databaseType)

Parameters

Name Data Type Description

key

string required

The authentication key

panelId

string required

The panel ID

surveyId

string required

The survey ID

fromDate

DateTime required

Specifies the from DateTime (including) when the credit was added. If you do not want to use from date, use DateTime.MinValue. The parameter will then be ignored in the whereclause.

toDate

DateTime required

Specifies the to DateTime (including) when the credit was added. If you do not want to use from date, use DateTime.MinValue. The parameter will then be ignored in the whereclause.

databaseType

DatabaseType required

Production or Test.

Response

Data Type Description

A collection of credits.

Example

//***************************************************
//
// Get all credits from survey to/from/between dates
//
//***************************************************

// Create instance of the webservice
PanelCreditSoapClient panelCredit = new PanelCreditSoapClient();

// NOTE: Credits will not be available if the respondent has not completed the spesific survey


//Example 1: How to get credits added to the panel for a spesific survey,
//between yesterday and seven days back

// Set fromDate to seven days back from today
fromDate = DateTime.Now.Subtract(new TimeSpan(7,0,0,0));

// Set toDate to yesterday
toDate = DateTime.Now.Subtract(new TimeSpan(1,0,0,0));

// TODO: navn p� variabler
// Get credits from panel for a spesific survey
PanelistCredit[] allCreditsFromSurveyBetween1 = panelCredit.GetAllCreditsFromSurveyBetween(key, panelId, surveyId, fromDate, toDate, DatabaseType.Production);

//Example 2: How to get credits added to the panel for a spesific survey,
// from last seven days

// Set fromDate to seven days back from today
fromDate = DateTime.Now.Subtract(new TimeSpan(7,0,0,0));

// Set toDate to MaxValue
toDate = DateTime.MaxValue;

// Get credits from panel for a spesific survey
PanelistCredit[] allCreditsFromSurveyBetween2 = panelCredit.GetAllCreditsFromSurveyBetween(key, panelId, surveyId, fromDate, toDate, DatabaseType.Production);



//Example 3: How to get credits added to the panel for a spesific survey
// up to last seven days

// Set fromDate to MinValue
fromDate = DateTime.MinValue;

// Set toDate to to seven days back from today
toDate = DateTime.Now.Subtract(new TimeSpan(7,0,0,0));

// Get credits from panel for a spesific survey
PanelistCredit[] allCreditsFromSurveyBetween3 = panelCredit.GetAllCreditsFromSurveyBetween(key, panelId, surveyId, fromDate, toDate, DatabaseType.Production);