Example #1
0
        /// <summary>
        /// Retrieves a paged list of templates provided by Survey Monkey.
        /// Notes
        ///     If templates are returned that the user cannot access, the `upgrade_info` dictionary will be returned
        /// Endpoint : https://api.surveymonkey.net/v2/templates/get_template_list?api_key=your_api_key
        /// Example Request
        /// curl -H 'Authorization:bearer XXXYYYZZZ' -H 'Content-Type: application/json' https://api.surveymonkey.net/v2/templates/get_template_list?api_key=your_api_key --data-binary '{"page": 1, "page_size": 10, "language_id": 1, "category_id": "131", "fields" : ["title"]}'
        /// </summary>
        private void BtnGetTemplateList_Click(object sender, EventArgs e)
        {
            GetTemplateListResponse templates;
            BasicRequestData        brd = GetRequestFields();

            if (chkFull.Checked)
            {
                templates = SurveyRequest.GetTemplateListFull(brd);
            }
            else
            {
                templates = SurveyRequest.GetTemplateList(brd);
            }

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

            try
            {
                dgvSurveyList.DataSource = templates.TemplateListResult.TemplateInfoList;
            }
            catch { } // do nothing
        }