示例#1
0
        /// <summary>
        /// Retrieves a paged list of respondents for a given survey and optionally collector
        /// Notes
        ///     Surveys with over 500,000 respondents will not be returned
        ///     DateStrings must be in the format YYYY-MM-DD HH:MM:SS.All DateStrings are implicitly in UTC.
        ///     All start dates are greater than or equal to the date passed in
        ///     All end dates are strictly less than date passed in
        ///     Basic users will only have the first 100 responses returned and will have the upgrade\_info dictionary
        /// Endpoint : https://api.surveymonkey.net/v2/surveys/get_respondent_list?api_key=your_api_key
        /// Example Request
        /// curl -H 'Authorization:bearer XXXYYYZZZ' -H 'Content-Type: application/json' https://api.surveymonkey.net/v2/surveys/get_respondent_list/?api_key=your_api_key --data-binary '{"survey_id": "100399456", "fields":["collector_id", "url", "open", "type", "name", "date_created", "date_modified"], "start_date":"2013-02-05 00:00:00", "end_date":"2013-04-16 22:47:00", "order_asc":true, "page_size":1, "page":2}'
        /// </summary>
        private void BtnGetRespondentList_Click(object sender, EventArgs e)
        {
            GetRespondentListResponse respondent;
            BasicRequestData          brd = GetRequestFields();

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

            if (chkFull.Checked)
            {
                respondent = SurveyRequest.GetRespondentListFull(brd);
            }
            else
            {
                respondent = SurveyRequest.GetRespondentList(brd);
            }

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

            try
            {
                dgvSurveyList.DataSource = respondent.RespondantListResult.RespondantList;
            }
            catch { } // do nothing
        }