Example #1
0
        /// <summary>
        /// Create a weblink collector.
        /// Notes
        ///     Basic users can create a maximum of 3 collectors per survey
        /// Endpoint : https://api.surveymonkey.net/v2/collectors/create_collector?api_key=your_api_key
        /// Example Request
        /// curl -H 'Authorization:bearer XXXYYYZZZ' -H 'Content-Type: application/json' https://api.surveymonkey.net/v2/collectors/create_collector?api_key=your_api_key --data-binary '{"survey_id": "100399456", "collector":{"type": "weblink", "name": "My Collector"}}'
        /// </summary>
        private void BtnCreateCollector_Click(object sender, EventArgs e)
        {
            CreateCollectorResponse collector;
            CreateCollectorRequest  brd = GetCCRequestFields();

            collector = SurveyRequest.CreateCollector(brd);

            lblStatus.Text   = collector.Status.ToString();
            lblErrorMsg.Text = collector.ErrorMessage;

            try
            {
                List <CollectorInfo> ciList = new List <CollectorInfo>();
                ciList.Add(collector.CollectorResult.Collector);
                dgvSurveyList.DataSource = ciList;
            }
            catch { } // do nothing
        }