Chilkat Online Tools

SQL Server / Zoom API / Update registrant's status

Back to Collection Items

-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
    DECLARE @hr int
    DECLARE @iTmp0 int
    -- Important: Do not use nvarchar(max).  See the warning about using nvarchar(max).
    DECLARE @sTmp0 nvarchar(4000)
    -- This example assumes the Chilkat API to have been previously unlocked.
    -- See Global Unlock Sample for sample code.

    DECLARE @http int
    -- Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT
    IF @hr <> 0
    BEGIN
        PRINT 'Failed to create ActiveX component'
        RETURN
    END

    DECLARE @success int

    DECLARE @req int
    -- Use "Chilkat_9_5_0.HttpRequest" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.HttpRequest', @req OUT

    EXEC sp_OASetProperty @req, 'HttpVerb', 'PUT'
    EXEC sp_OASetProperty @req, 'Path', '/'
    EXEC sp_OASetProperty @req, 'ContentType', 'multipart/form-data'
    EXEC sp_OAMethod @req, 'AddParam', NULL, 'action', 'approve'

    EXEC sp_OAMethod @req, 'AddParam', NULL, 'registrants', 'approve[{"id":"Lorem eu proident nisi","email":"U2L5Cl@WvziDFQsCRWabPGmQmiVkoOCzi.hjl"},{"id":"in exercitation","email":"sxjTdagQI@rOjUGinp.xkki"}]'

    EXEC sp_OAMethod @req, 'AddHeader', NULL, 'Authorization', 'Bearer <access_token>'

    DECLARE @resp int
    EXEC sp_OAMethod @http, 'SynchronousRequest', @resp OUT, 'reprehenderit', 80, 0, @req
    EXEC sp_OAGetProperty @http, 'LastMethodSuccess', @iTmp0 OUT
    IF @iTmp0 = 0
      BEGIN
        EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
        PRINT @sTmp0
        EXEC @hr = sp_OADestroy @http
        EXEC @hr = sp_OADestroy @req
        RETURN
      END

    EXEC sp_OAGetProperty @resp, 'StatusCode', @iTmp0 OUT
    PRINT @iTmp0
    EXEC sp_OAGetProperty @resp, 'BodyStr', @sTmp0 OUT
    PRINT @sTmp0
    EXEC @hr = sp_OADestroy @resp


    EXEC @hr = sp_OADestroy @http
    EXEC @hr = sp_OADestroy @req


END
GO

Curl Command

curl -X PUT
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: multipart/form-data"
	--form 'action=approve'
	--form 'registrants=approve[{"id":"Lorem eu proident nisi","email":"U2L5Cl@WvziDFQsCRWabPGmQmiVkoOCzi.hjl"},{"id":"in exercitation","email":"sxjTdagQI@rOjUGinp.xkki"}]'
https://api.zoom.us/v2/webinars/:webinarId/registrants/status?occurrence_id=quis officia in reprehenderit

Postman Collection Item JSON

{
  "name": "Update registrant's status",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "PUT",
    "header": [
      {
        "key": "Content-Type",
        "value": "multipart/form-data"
      }
    ],
    "body": {
      "mode": "formdata",
      "formdata": [
        {
          "key": "action",
          "value": "approve",
          "description": "(Required) The registration action to perform: \n* `approve` — Approve the registrant. \n* `deny` — Reject the registrant. \n* `cancel` — Cancel the registrant's approval. (This can only be one of approve,deny,cancel)",
          "type": "text"
        },
        {
          "key": "registrants",
          "value": "[{\"id\":\"Lorem eu proident nisi\",\"email\":\"U2L5Cl@WvziDFQsCRWabPGmQmiVkoOCzi.hjl\"},{\"id\":\"in exercitation\",\"email\":\"sxjTdagQI@rOjUGinp.xkki\"}]",
          "description": "The registrant information.",
          "type": "text"
        }
      ]
    },
    "url": {
      "raw": "{{baseUrl}}/webinars/:webinarId/registrants/status?occurrence_id=quis officia in reprehenderit",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "webinars",
        ":webinarId",
        "registrants",
        "status"
      ],
      "query": [
        {
          "key": "occurrence_id",
          "value": "quis officia in reprehenderit",
          "description": "The meeting or webinar occurrence ID."
        }
      ],
      "variable": [
        {
          "key": "webinarId",
          "value": "68423085",
          "description": "(Required) The webinar's ID."
        }
      ]
    },
    "description": "Use this API to update webinar registrants' registration status. You can approve or deny a registrant, or revoke a registrant's approval. \n\n**Scopes:** `webinar:write:admin`, `webinar:write` <br> **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`"
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `200` <br>\n The 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": "deny",
              "description": "(Required) The registration action to perform: \n* `approve` — Approve the registrant. \n* `deny` — Reject the registrant. \n* `cancel` — Cancel the registrant's approval. (This can only be one of approve,deny,cancel)",
              "type": "text"
            },
            {
              "key": "registrants",
              "value": "[{\"id\":\"amet ea cupidatat\",\"email\":\"5loc@zQ.wwfi\"},{\"id\":\"elit dolor nulla\",\"email\":\"5FcMsdVVO8dg@rieejuEUEMMdhkzlCaxBsUN.zdn\"}]",
              "description": "The registrant information.",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/registrants/status?occurrence_id=quis officia in reprehenderit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "registrants",
            "status"
          ],
          "query": [
            {
              "key": "occurrence_id",
              "value": "quis officia in reprehenderit"
            }
          ],
          "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": "**HTTP Status Code:** `204` <br>\n Registrant 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": "deny",
              "description": "(Required) The registration action to perform: \n* `approve` — Approve the registrant. \n* `deny` — Reject the registrant. \n* `cancel` — Cancel the registrant's approval. (This can only be one of approve,deny,cancel)",
              "type": "text"
            },
            {
              "key": "registrants",
              "value": "[{\"id\":\"amet ea cupidatat\",\"email\":\"5loc@zQ.wwfi\"},{\"id\":\"elit dolor nulla\",\"email\":\"5FcMsdVVO8dg@rieejuEUEMMdhkzlCaxBsUN.zdn\"}]",
              "description": "The registrant information.",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/registrants/status?occurrence_id=quis officia in reprehenderit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "registrants",
            "status"
          ],
          "query": [
            {
              "key": "occurrence_id",
              "value": "quis officia in reprehenderit"
            }
          ],
          "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:** `300` <br> Invalid webinar ID.",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "action",
              "value": "deny",
              "description": "(Required) The registration action to perform: \n* `approve` — Approve the registrant. \n* `deny` — Reject the registrant. \n* `cancel` — Cancel the registrant's approval. (This can only be one of approve,deny,cancel)",
              "type": "text"
            },
            {
              "key": "registrants",
              "value": "[{\"id\":\"amet ea cupidatat\",\"email\":\"5loc@zQ.wwfi\"},{\"id\":\"elit dolor nulla\",\"email\":\"5FcMsdVVO8dg@rieejuEUEMMdhkzlCaxBsUN.zdn\"}]",
              "description": "The registrant information.",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/registrants/status?occurrence_id=quis officia in reprehenderit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "registrants",
            "status"
          ],
          "query": [
            {
              "key": "occurrence_id",
              "value": "quis officia in reprehenderit"
            }
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "68423085",
              "description": "(Required) The webinar's ID."
            }
          ]
        }
      },
      "status": "Multiple Choices",
      "code": 300,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTP Status Code:** `400` <br>\n Bad request \n\n **Error Code:** `1010` <br>\n User does not belong to this account: {accountId}. \n\n **Error Code:** `3035` <br>\n Webinar has reached maximum attendee capacity.",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "action",
              "value": "deny",
              "description": "(Required) The registration action to perform: \n* `approve` — Approve the registrant. \n* `deny` — Reject the registrant. \n* `cancel` — Cancel the registrant's approval. (This can only be one of approve,deny,cancel)",
              "type": "text"
            },
            {
              "key": "registrants",
              "value": "[{\"id\":\"amet ea cupidatat\",\"email\":\"5loc@zQ.wwfi\"},{\"id\":\"elit dolor nulla\",\"email\":\"5FcMsdVVO8dg@rieejuEUEMMdhkzlCaxBsUN.zdn\"}]",
              "description": "The registrant information.",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/registrants/status?occurrence_id=quis officia in reprehenderit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "registrants",
            "status"
          ],
          "query": [
            {
              "key": "occurrence_id",
              "value": "quis officia in reprehenderit"
            }
          ],
          "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>\n Webinar not found. \n\n **Error Code:** `1001` <br>\n User {userId} does not exist or does not belong to this account. \n\n **Error Code:** `3001` <br>\n Webinar {webinarId} not found or has expired.",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "action",
              "value": "deny",
              "description": "(Required) The registration action to perform: \n* `approve` — Approve the registrant. \n* `deny` — Reject the registrant. \n* `cancel` — Cancel the registrant's approval. (This can only be one of approve,deny,cancel)",
              "type": "text"
            },
            {
              "key": "registrants",
              "value": "[{\"id\":\"amet ea cupidatat\",\"email\":\"5loc@zQ.wwfi\"},{\"id\":\"elit dolor nulla\",\"email\":\"5FcMsdVVO8dg@rieejuEUEMMdhkzlCaxBsUN.zdn\"}]",
              "description": "The registrant information.",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/registrants/status?occurrence_id=quis officia in reprehenderit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "registrants",
            "status"
          ],
          "query": [
            {
              "key": "occurrence_id",
              "value": "quis officia in reprehenderit"
            }
          ],
          "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": ""
    },
    {
      "name": "**HTTP Status Code:** `429` <br>\n You have exceeded the daily rate limit of \"{0}\" for webinar **Update registrant's status** API requests for the registrant \"{1}\". You can resume these API requests at GMT 00:00:00.",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "action",
              "value": "deny",
              "description": "(Required) The registration action to perform: \n* `approve` — Approve the registrant. \n* `deny` — Reject the registrant. \n* `cancel` — Cancel the registrant's approval. (This can only be one of approve,deny,cancel)",
              "type": "text"
            },
            {
              "key": "registrants",
              "value": "[{\"id\":\"amet ea cupidatat\",\"email\":\"5loc@zQ.wwfi\"},{\"id\":\"elit dolor nulla\",\"email\":\"5FcMsdVVO8dg@rieejuEUEMMdhkzlCaxBsUN.zdn\"}]",
              "description": "The registrant information.",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/registrants/status?occurrence_id=quis officia in reprehenderit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "registrants",
            "status"
          ],
          "query": [
            {
              "key": "occurrence_id",
              "value": "quis officia in reprehenderit"
            }
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "68423085",
              "description": "(Required) The webinar's ID."
            }
          ]
        }
      },
      "status": "Too Many Requests",
      "code": 429,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}