示例#1
0
        /// <summary>
        /// Create a survey based on template or existing survey.
        /// Notes
        ///     You cannot specify both template\_id and from\_survey\_id
        /// Endpoint : https://api.surveymonkey.net/v2/surveys/create_survey?api_key=your_api_key
        /// Example Request
        /// curl -H 'Authorization:bearer XXXYYYZZZ' -H 'Content-Type: application/json' https://api.surveymonkey.net/v2/surveys/create_survey?api_key=your_api_key --data-binary '{"template_id": "568", "survey_title": "Ice and Fire Event"}'
        /// </summary>
        private void BtnCreateSurvey_Click(object sender, EventArgs e)
        {
            CreateSurveyResponse survey;
            BasicRequestData     brd = GetRequestFields();

            survey = SurveyRequest.CreateSurvey(brd);

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

            List <SurveyInfo> sInfoList = new List <SurveyInfo>();

            try
            {
                sInfoList.Add(survey.Survey);
                dgvSurveyList.DataSource = sInfoList;
            }
            catch { } // do nothing
        }