GetTopNCreditsFromPanelist

Description

Gets top N credits for a given panelist

Signature
PanelistCredit[] GetTopNCreditsFromPanelist(string key, string panelId, int panelistId, int topN, int startPosition, bool orderAscending, DatabaseType databaseType)

Parameters

Name Data Type Description

key

string required

The authentication key

panelId

string required

The panel ID

panelistId

int required

The panelist ID

topN

int required

The number of credits to return

startPosition

int required

The creditId from where to start

orderAscending

bool required

Sort credits ascending/descending

databaseType

DatabaseType required

Production or Test.

Response

Data Type Description

A collection of credits.

Example

//***************************************************
//
// Get topN credits from panelist
//
//***************************************************

// 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 the last two credits added to the panel, for a spesific panelist

// To find topN credits we must first find which creditId to use as startpositon.
// CreditId is a unique identifier for all credits in a panel.
// Find creditId for the second (index=1) added credit:
PanelistCredit[] panelistCreditsAll = panelCredit.GetAllCreditsFromPanelist(key, panelId, panelistId, DatabaseType.Production);
creditId = panelistCreditsAll[1].CreditId;
startPosition = creditId;

// To get the TopN last credits, we must order descending
orderAscending = false;

// Specify how many credits to return
topN = 2;

// Get topN credits from panelist
PanelistCredit[] topNCreditsFromPanelist1 = panelCredit.GetTopNCreditsFromPanelist(key, panelId, panelistId, topN, startPosition, orderAscending, DatabaseType.Production);



// Example 2: How to get the first two credits added to the panel, for a spesific panelist

// To find topN credits we must first find which creditId to use as startpositon.
// CreditId is a unique identifier for all credits in a panel.
// Find creditId for the second (index=1) added credit:
PanelistCredit[] panelistCreditsAll2 = panelCredit.GetAllCreditsFromPanelist(key, panelId, panelistId, DatabaseType.Production);
creditId = panelistCreditsAll2[1].CreditId;
startPosition = creditId;

// To get the TopN first credits, we must order ascending
orderAscending = true;

// Specify how many credits to return
topN = 2;

// Get topN credits from panelist
PanelistCredit[] topNCreditsFromPanelist2 = panelCredit.GetTopNCreditsFromPanelist(key, panelId, panelistId, topN, startPosition, orderAscending, DatabaseType.Production);