Chilkat Online Tools

Swift3 / Zoom API / Update webinar status

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 = "PUT"
    req.path = "/v2/webinars/:webinarId/status"
    req.contentType = "multipart/form-data"
    req.addParam("action", value: "end")

    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
    }

    print("\(resp!.statusCode.intValue)")
    print("\(resp!.bodyStr!)")
    resp = nil

}

Curl Command

curl -X PUT
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: multipart/form-data"
	--form 'action=end'
https://api.zoom.us/v2/webinars/:webinarId/status

Postman Collection Item JSON

{
  "name": "Update webinar status",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "PUT",
    "header": [
      {
        "key": "Content-Type",
        "value": "multipart/form-data"
      }
    ],
    "body": {
      "mode": "formdata",
      "formdata": [
        {
          "key": "action",
          "value": "end",
          "description": " (This can only be one of end)",
          "type": "text"
        }
      ]
    },
    "url": {
      "raw": "{{baseUrl}}/webinars/:webinarId/status",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "webinars",
        ":webinarId",
        "status"
      ],
      "variable": [
        {
          "key": "webinarId",
          "value": "68423085",
          "description": "(Required) The webinar's ID."
        }
      ]
    },
    "description": "Update a webinar's status. Use this API to end an ongoing webinar.<br><br>\n**Scopes:** `webinar:write:admin` `webinar:write`<br>\n \n **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`<br>\n**Prerequisites:**<br>\n* The account must hold a valid [Webinar plan](https://zoom.us/webinar)."
  },
  "response": [
    {
      "name": "Webinar plan subscription is missing. Enable webinar for this user once the subscription is added:{userId}.",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "action",
              "value": "end",
              "description": " (This can only be one of end)",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/status",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "status"
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "68423085",
              "description": "(Required) The webinar's ID."
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "Webinar's status updated.",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "action",
              "value": "end",
              "description": " (This can only be one of end)",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/status",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "status"
          ],
          "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>\nBad request<br>\n**Error Code:** `1010`<br>\nUser does not belong to this account:{accountId}.<br>\n**Error Code:** `3003`<br>\nYou are not the meeting host.<br>\n**Error Code:** `3063`<br>\nCan not end on-premise user's meeting:",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "action",
              "value": "end",
              "description": " (This can only be one of end)",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/status",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "status"
          ],
          "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>\nWebinar not found.<br>\n**Error Code:** `1001`<br>\nUser {userId} does not exist or does not belong to this account.<br>\n**Error Code:** `3001`<br>\nWebinar {webinarId} not found or has expired.<br>",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "action",
              "value": "end",
              "description": " (This can only be one of end)",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/status",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "status"
          ],
          "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": ""
    }
  ]
}