Esempio n. 1
0
        /// <summary>
        /// Returns how many respondents have started and/or completed the survey for the given collector.
        /// Endpoint : https://api.surveymonkey.net/v2/surveys/get_response_counts?api_key=your_api_key
        /// Example Request
        /// curl -H 'Authorization:bearer XXXYYYZZZ' -H 'Content-Type: application/json' https://api.surveymonkey.net/v2/surveys/get_response_counts/?api_key=your_api_key --data-binary '{"collector_id": "23907195"}'
        /// </summary>
        private void BtnGetResponseCounts_Click(object sender, EventArgs e)
        {
            GetResponseCountsResponse respondent;
            BasicRequestData          brd = GetRequestFields();

            if (brd.CollectorID == null)
            {
                MessageBox.Show("no collector id specified.  Going to get error back.");
            }

            try
            {
                respondent = SurveyRequest.GetResponseCounts(brd);

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


                List <GetResponseCountsResult> rList = new List <GetResponseCountsResult>();
                rList.Add(respondent.ResponseCountResult);
                dgvSurveyList.DataSource = rList;
            }
            catch { } // do nothing
        }