Chilkat Online Tools

unicodeC / Zoom API / Update a webinar survey

Back to Collection Items

#include <C_CkHttpW.h>
#include <C_CkHttpRequestW.h>
#include <C_CkHttpResponseW.h>

void ChilkatSample(void)
    {
    HCkHttpW http;
    BOOL success;
    HCkHttpRequestW req;
    HCkHttpResponseW resp;
    int respStatusCode;

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    http = CkHttpW_Create();

    req = CkHttpRequestW_Create();
    CkHttpRequestW_putHttpVerb(req,L"PATCH");
    CkHttpRequestW_putPath(req,L"/v2/webinars/:webinarId/survey");
    CkHttpRequestW_putContentType(req,L"multipart/form-data");
    CkHttpRequestW_AddParam(req,L"third_party_survey",L"ullamco aute sit adi");

    CkHttpRequestW_AddParam(req,L"custom_survey",L"ullamco aute sit adi{\"anonymous\":false,\"questions\":[{\"name\":\"aliqua \",\"type\":\"long_answer\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"sint Excepteur\",\"qui tempor quis laboris\"],\"answer_min_character\":59368162,\"answer_max_character\":-57090280,\"rating_min_value\":6871526,\"rating_max_value\":-286025,\"rating_min_label\":\"Excepteur adipisicing\",\"rating_max_label\":\"quis fugiat qui cillum\"},{\"name\":\"culpa\",\"type\":\"single\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"commodo d\",\"laboris proident cillum\"],\"answer_min_character\":34670518,\"answer_max_character\":34438852,\"rating_min_value\":600570,\"rating_max_value\":-91541353,\"rating_min_label\":\"eiusmod in\",\"rating_max_label\":\"sint amet\"}]}");

    CkHttpRequestW_AddParam(req,L"show_in_the_follow_up_email",L"ullamco aute sit adi{\"anonymous\":false,\"questions\":[{\"name\":\"aliqua \",\"type\":\"long_answer\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"sint Excepteur\",\"qui tempor quis laboris\"],\"answer_min_character\":59368162,\"answer_max_character\":-57090280,\"rating_min_value\":6871526,\"rating_max_value\":-286025,\"rating_min_label\":\"Excepteur adipisicing\",\"rating_max_label\":\"quis fugiat qui cillum\"},{\"name\":\"culpa\",\"type\":\"single\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"commodo d\",\"laboris proident cillum\"],\"answer_min_character\":34670518,\"answer_max_character\":34438852,\"rating_min_value\":600570,\"rating_max_value\":-91541353,\"rating_min_label\":\"eiusmod in\",\"rating_max_label\":\"sint amet\"}]}false");

    CkHttpRequestW_AddParam(req,L"show_in_the_browser",L"ullamco aute sit adi{\"anonymous\":false,\"questions\":[{\"name\":\"aliqua \",\"type\":\"long_answer\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"sint Excepteur\",\"qui tempor quis laboris\"],\"answer_min_character\":59368162,\"answer_max_character\":-57090280,\"rating_min_value\":6871526,\"rating_max_value\":-286025,\"rating_min_label\":\"Excepteur adipisicing\",\"rating_max_label\":\"quis fugiat qui cillum\"},{\"name\":\"culpa\",\"type\":\"single\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"commodo d\",\"laboris proident cillum\"],\"answer_min_character\":34670518,\"answer_max_character\":34438852,\"rating_min_value\":600570,\"rating_max_value\":-91541353,\"rating_min_label\":\"eiusmod in\",\"rating_max_label\":\"sint amet\"}]}falsetrue");

    CkHttpRequestW_AddHeader(req,L"Authorization",L"Bearer <access_token>");

    resp = CkHttpW_SynchronousRequest(http,L"api.zoom.us",443,TRUE,req);
    if (CkHttpW_getLastMethodSuccess(http) == FALSE) {
        wprintf(L"%s\n",CkHttpW_lastErrorText(http));
        CkHttpW_Dispose(http);
        CkHttpRequestW_Dispose(req);
        return;
    }

    respStatusCode = CkHttpResponseW_getStatusCode(resp);
    wprintf(L"Response Status Code = %d\n",respStatusCode);
    if (respStatusCode != 204) {
        wprintf(L"Response Header:\n");
        wprintf(L"%s\n",CkHttpResponseW_header(resp));
        wprintf(L"Response Body:\n");
        wprintf(L"%s\n",CkHttpResponseW_bodyStr(resp));
        wprintf(L"Failed.\n");
        CkHttpResponseW_Dispose(resp);
        CkHttpW_Dispose(http);
        CkHttpRequestW_Dispose(req);
        return;
    }

    CkHttpResponseW_Dispose(resp);
    wprintf(L"Success.\n");


    CkHttpW_Dispose(http);
    CkHttpRequestW_Dispose(req);

    }

Curl Command

curl -X PATCH
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: multipart/form-data"
	--form 'third_party_survey=ullamco aute sit adi'
	--form 'custom_survey=ullamco aute sit adi{"anonymous":false,"questions":[{"name":"aliqua ","type":"long_answer","show_as_dropdown":false,"answer_required":false,"answers":["sint Excepteur","qui tempor quis laboris"],"answer_min_character":59368162,"answer_max_character":-57090280,"rating_min_value":6871526,"rating_max_value":-286025,"rating_min_label":"Excepteur adipisicing","rating_max_label":"quis fugiat qui cillum"},{"name":"culpa","type":"single","show_as_dropdown":false,"answer_required":false,"answers":["commodo d","laboris proident cillum"],"answer_min_character":34670518,"answer_max_character":34438852,"rating_min_value":600570,"rating_max_value":-91541353,"rating_min_label":"eiusmod in","rating_max_label":"sint amet"}]}'
	--form 'show_in_the_follow_up_email=ullamco aute sit adi{"anonymous":false,"questions":[{"name":"aliqua ","type":"long_answer","show_as_dropdown":false,"answer_required":false,"answers":["sint Excepteur","qui tempor quis laboris"],"answer_min_character":59368162,"answer_max_character":-57090280,"rating_min_value":6871526,"rating_max_value":-286025,"rating_min_label":"Excepteur adipisicing","rating_max_label":"quis fugiat qui cillum"},{"name":"culpa","type":"single","show_as_dropdown":false,"answer_required":false,"answers":["commodo d","laboris proident cillum"],"answer_min_character":34670518,"answer_max_character":34438852,"rating_min_value":600570,"rating_max_value":-91541353,"rating_min_label":"eiusmod in","rating_max_label":"sint amet"}]}false'
	--form 'show_in_the_browser=ullamco aute sit adi{"anonymous":false,"questions":[{"name":"aliqua ","type":"long_answer","show_as_dropdown":false,"answer_required":false,"answers":["sint Excepteur","qui tempor quis laboris"],"answer_min_character":59368162,"answer_max_character":-57090280,"rating_min_value":6871526,"rating_max_value":-286025,"rating_min_label":"Excepteur adipisicing","rating_max_label":"quis fugiat qui cillum"},{"name":"culpa","type":"single","show_as_dropdown":false,"answer_required":false,"answers":["commodo d","laboris proident cillum"],"answer_min_character":34670518,"answer_max_character":34438852,"rating_min_value":600570,"rating_max_value":-91541353,"rating_min_label":"eiusmod in","rating_max_label":"sint amet"}]}falsetrue'
https://api.zoom.us/v2/webinars/:webinarId/survey

Postman Collection Item JSON

{
  "name": "Update a webinar survey",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "PATCH",
    "header": [
      {
        "key": "Content-Type",
        "value": "multipart/form-data"
      }
    ],
    "body": {
      "mode": "formdata",
      "formdata": [
        {
          "key": "third_party_survey",
          "value": "ullamco aute sit adi",
          "description": "undefined",
          "type": "text"
        },
        {
          "key": "custom_survey",
          "value": "{\"anonymous\":false,\"questions\":[{\"name\":\"aliqua \",\"type\":\"long_answer\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"sint Excepteur\",\"qui tempor quis laboris\"],\"answer_min_character\":59368162,\"answer_max_character\":-57090280,\"rating_min_value\":6871526,\"rating_max_value\":-286025,\"rating_min_label\":\"Excepteur adipisicing\",\"rating_max_label\":\"quis fugiat qui cillum\"},{\"name\":\"culpa\",\"type\":\"single\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"commodo d\",\"laboris proident cillum\"],\"answer_min_character\":34670518,\"answer_max_character\":34438852,\"rating_min_value\":600570,\"rating_max_value\":-91541353,\"rating_min_label\":\"eiusmod in\",\"rating_max_label\":\"sint amet\"}]}",
          "description": "undefined",
          "type": "text"
        },
        {
          "key": "show_in_the_follow_up_email",
          "value": "false",
          "description": "undefined",
          "type": "text"
        },
        {
          "key": "show_in_the_browser",
          "value": "true",
          "description": "undefined",
          "type": "text"
        }
      ]
    },
    "url": {
      "raw": "{{baseUrl}}/webinars/:webinarId/survey",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "webinars",
        ":webinarId",
        "survey"
      ],
      "variable": [
        {
          "key": "webinarId",
          "value": "68423085",
          "description": "(Required) The webinar's ID."
        }
      ]
    },
    "description": "Use this API to update a [webinar survey](https://support.zoom.us/hc/en-us/articles/360048745651). \n\n **Scopes:** `webinar:write`, `webinar:write:admin` <br> **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light` \n\n **Prerequisites:** \n* A Pro or higher plan with the Webinar add-on. \n* The [**Webinar Survey**](https://support.zoom.us/hc/en-us/articles/360061293191-Enabling-webinar-survey) feature enabled in the host's account."
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `204` <br>\n Webinar survey updated.",
      "originalRequest": {
        "method": "PATCH",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "third_party_survey",
              "value": "eu ut in amet e",
              "description": "undefined",
              "type": "text"
            },
            {
              "key": "custom_survey",
              "value": "{\"anonymous\":false,\"questions\":[{\"name\":\"qui est magna\",\"type\":\"rating_scale\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"sed dolor\",\"irure deserunt\"],\"answer_min_character\":70990159,\"answer_max_character\":44743900,\"rating_min_value\":10835653,\"rating_max_value\":-88768510,\"rating_min_label\":\"Lorem quis\",\"rating_max_label\":\"magna labore consectetur dolore est\"},{\"name\":\"nisi Ut non\",\"type\":\"multiple\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"sed proident\",\"magna dolore adipisicing ut\"],\"answer_min_character\":83676632,\"answer_max_character\":46051900,\"rating_min_value\":18596642,\"rating_max_value\":-39048943,\"rating_min_label\":\"mollit nostrud esse culpa\",\"rating_max_label\":\"ad velit\"}]}",
              "description": "undefined",
              "type": "text"
            },
            {
              "key": "show_in_the_follow_up_email",
              "value": "false",
              "description": "undefined",
              "type": "text"
            },
            {
              "key": "show_in_the_browser",
              "value": "true",
              "description": "undefined",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/survey",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "survey"
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "68423085",
              "description": "(Required) The webinar's ID."
            }
          ]
        }
      },
      "status": "No Content",
      "code": 204,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTP Status Code:** `400` <br> Bad Request \n\n **Error Code:** `300` <br>\n * Invalid webinar ID. <br>\n * Invalid third party survey: {third_party_survey}. \n\n **Error Code:** `3000` <br>\n Webinar survey disabled. To enable this feature, enable the \"Webina",
      "originalRequest": {
        "method": "PATCH",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "third_party_survey",
              "value": "eu ut in amet e",
              "description": "undefined",
              "type": "text"
            },
            {
              "key": "custom_survey",
              "value": "{\"anonymous\":false,\"questions\":[{\"name\":\"qui est magna\",\"type\":\"rating_scale\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"sed dolor\",\"irure deserunt\"],\"answer_min_character\":70990159,\"answer_max_character\":44743900,\"rating_min_value\":10835653,\"rating_max_value\":-88768510,\"rating_min_label\":\"Lorem quis\",\"rating_max_label\":\"magna labore consectetur dolore est\"},{\"name\":\"nisi Ut non\",\"type\":\"multiple\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"sed proident\",\"magna dolore adipisicing ut\"],\"answer_min_character\":83676632,\"answer_max_character\":46051900,\"rating_min_value\":18596642,\"rating_max_value\":-39048943,\"rating_min_label\":\"mollit nostrud esse culpa\",\"rating_max_label\":\"ad velit\"}]}",
              "description": "undefined",
              "type": "text"
            },
            {
              "key": "show_in_the_follow_up_email",
              "value": "false",
              "description": "undefined",
              "type": "text"
            },
            {
              "key": "show_in_the_browser",
              "value": "true",
              "description": "undefined",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/survey",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "survey"
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "68423085",
              "description": "(Required) The webinar's ID."
            }
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTP Status Code:** `404` <br> Not Found \n\n **Error Code:** `300` <br>\n Webinar ID does not exist. \n\n **Error Code:** `3001` <br>\n Webinar does not exist: {webinarId}.",
      "originalRequest": {
        "method": "PATCH",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "third_party_survey",
              "value": "eu ut in amet e",
              "description": "undefined",
              "type": "text"
            },
            {
              "key": "custom_survey",
              "value": "{\"anonymous\":false,\"questions\":[{\"name\":\"qui est magna\",\"type\":\"rating_scale\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"sed dolor\",\"irure deserunt\"],\"answer_min_character\":70990159,\"answer_max_character\":44743900,\"rating_min_value\":10835653,\"rating_max_value\":-88768510,\"rating_min_label\":\"Lorem quis\",\"rating_max_label\":\"magna labore consectetur dolore est\"},{\"name\":\"nisi Ut non\",\"type\":\"multiple\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"sed proident\",\"magna dolore adipisicing ut\"],\"answer_min_character\":83676632,\"answer_max_character\":46051900,\"rating_min_value\":18596642,\"rating_max_value\":-39048943,\"rating_min_label\":\"mollit nostrud esse culpa\",\"rating_max_label\":\"ad velit\"}]}",
              "description": "undefined",
              "type": "text"
            },
            {
              "key": "show_in_the_follow_up_email",
              "value": "false",
              "description": "undefined",
              "type": "text"
            },
            {
              "key": "show_in_the_browser",
              "value": "true",
              "description": "undefined",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/survey",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "survey"
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "68423085",
              "description": "(Required) The webinar's ID."
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}