GetTopNCreditsFromPanel
Description
Gets top N credits for a given panel
Signature
PanelistCredit[] GetTopNCreditsFromPanel(string key, string panelId, 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 |
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. |
Example
//***************************************************
//
// Get topN credits from panel
//
//***************************************************
// 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
// 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[] panelCreditsAll = panelCredit.GetAllCreditsFromPanel(key, panelId, DatabaseType.Production);
creditId = panelCreditsAll[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 panel
PanelistCredit[] topNCreditsFromPanel1 = panelCredit.GetTopNCreditsFromPanel(key, panelId, topN, startPosition, orderAscending, DatabaseType.Production);
// Example 2: How to get the first two credits added to the panel
// 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[] panelCreditsAll2 = panelCredit.GetAllCreditsFromPanel(key, panelId, DatabaseType.Production);
creditId = panelCreditsAll[1].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 panel
PanelistCredit[] topNCreditsFromPanel2 = panelCredit.GetTopNCreditsFromPanel(key, panelId, topN, startPosition, orderAscending, DatabaseType.Production);