Chilkat Online Tools

Swift3 / Zoom API / Update a webinar survey

Back to Collection Items

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

    let http = CkoHttp()!
    var success: Bool

    let req = CkoHttpRequest()!
    req.httpVerb = "PATCH"
    req.path = "/v2/webinars/:webinarId/survey"
    req.contentType = "multipart/form-data"
    req.addParam("third_party_survey", value: "ullamco aute sit adi")

    req.addParam("custom_survey", value: "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\"}]}")

    req.addParam("show_in_the_follow_up_email", value: "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")

    req.addParam("show_in_the_browser", value: "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")

    req.addHeader("Authorization", value: "Bearer <access_token>")

    var resp: CkoHttpResponse? = http.synchronousRequest("api.zoom.us", port: 443, ssl: true, req: req)
    if http.lastMethodSuccess == false {
        print("\(http.lastErrorText!)")
        return
    }

    var respStatusCode: Int = resp!.statusCode.intValue
    print("Response Status Code = \(respStatusCode)")
    if respStatusCode != 204 {
        print("Response Header:")
        print("\(resp!.header!)")
        print("Response Body:")
        print("\(resp!.bodyStr!)")
        print("Failed.")
        resp = nil
        return
    }

    resp = nil
    print("Success.")

}

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": ""
    }
  ]
}