GetQuota

Description

Get a single Quota

Signature
SurveySchema GetQuota(string key, string projectId, string name, bool projectSpecific)

Parameters

Name Data Type Description

key

string required

The authentication key

projectId

string required

ID of the project

name

string required

Name of the Quota

projectSpecific

bool required

True means that the questionnaire should be linked to the project and can be updated, False means that the questionnaire should not be linked to the project and can be used to update other projects.

Response

Data Type Description

ObjectStructure containing Quota

Example

// Create instance of the webservice
var SurveyDesign = new SurveyDesignSoapClient();

//***************************************************
//
// Retrieve, change and update Quota
//
//***************************************************

// Get Quota named quota1, projectspecific to enable update
SurveySchema def = SurveyDesign.GetQuota(key,projectID,"quota1",true);

// Get the quota
Quota quota = (Quota)def.Root.Nodes.GetValue(0);

// Check that the quota exists
if (quota==null)
	throwError();

// Change quota name
quota.Name = "NewQuotaName";

// Change quota emailaddress
quota.EmailAddress = "dummy@dummy.dummy";

// Create a new reference to an existing SingleQuestion called s1
FormReference formReference = SurveyDesignUtil.NewFormReference("s1");

// Add the reference to the quota
ArrayList forms = new ArrayList((Array)quota.Forms);
forms.Add(formReference);
quota.Forms = (FormReference[])forms.ToArray(typeof(FormReference));

// Update the quota
SurveyDesign.Update(key,projectID,def);