Chilkat Online Tools

delphiDll / Zoom API / Update a webinar survey

Back to Collection Items

var
http: HCkHttp;
success: Boolean;
req: HCkHttpRequest;
resp: HCkHttpResponse;
respStatusCode: Integer;

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

http := CkHttp_Create();

req := CkHttpRequest_Create();
CkHttpRequest_putHttpVerb(req,'PATCH');
CkHttpRequest_putPath(req,'/v2/webinars/:webinarId/survey');
CkHttpRequest_putContentType(req,'multipart/form-data');
CkHttpRequest_AddParam(req,'third_party_survey','ullamco aute sit adi');

CkHttpRequest_AddParam(req,'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"}]}');

CkHttpRequest_AddParam(req,'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');

CkHttpRequest_AddParam(req,'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');

CkHttpRequest_AddHeader(req,'Authorization','Bearer <access_token>');

resp := CkHttp_SynchronousRequest(http,'api.zoom.us',443,True,req);
if (CkHttp_getLastMethodSuccess(http) = False) then
  begin
    Memo1.Lines.Add(CkHttp__lastErrorText(http));
    Exit;
  end;

respStatusCode := CkHttpResponse_getStatusCode(resp);
Memo1.Lines.Add('Response Status Code = ' + IntToStr(respStatusCode));
if (respStatusCode <> 204) then
  begin
    Memo1.Lines.Add('Response Header:');
    Memo1.Lines.Add(CkHttpResponse__header(resp));
    Memo1.Lines.Add('Response Body:');
    Memo1.Lines.Add(CkHttpResponse__bodyStr(resp));
    Memo1.Lines.Add('Failed.');
    CkHttpResponse_Dispose(resp);
    Exit;
  end;
CkHttpResponse_Dispose(resp);
Memo1.Lines.Add('Success.');

CkHttp_Dispose(http);
CkHttpRequest_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": ""
    }
  ]
}