Chilkat Online Tools

DataFlex / Zoom API / Perform batch registration

Back to Collection Items

Use ChilkatAx-9.5.0-win32.pkg

Procedure Test
    Handle hoHttp
    Boolean iSuccess
    Variant vReq
    Handle hoReq
    Variant vResp
    Handle hoResp
    Variant vSbResponseBody
    Handle hoSbResponseBody
    Handle hoJResp
    Integer iRespStatusCode
    String sRegistrant_id
    String sEmail
    String sJoin_url
    Integer i
    Integer iCount_i
    String sTemp1
    Boolean bTemp1

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

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

    Get Create (RefClass(cComChilkatHttpRequest)) To hoReq
    If (Not(IsComObjectCreated(hoReq))) Begin
        Send CreateComObject of hoReq
    End
    Set ComHttpVerb Of hoReq To "POST"
    Set ComPath Of hoReq To "/v2/webinars/:webinarId/batch_registrants"
    Set ComContentType Of hoReq To "multipart/form-data"
    Send ComAddParam To hoReq "auto_approve" "true"

    Send ComAddParam To hoReq "registrants" 'true[{"first_name":"dolore eu aute dolor","email":"KEESPCs-T1pF@ljUbrzdNgzMc.xx","last_name":"eu reprehenderit ea magna ex"},{"first_name":"aliquip deserunt","email":"okZ9KNk@nZOovoEvyoTCgW.eftt","last_name":"nostrud"}]'

    Send ComAddHeader To hoReq "Authorization" "Bearer <access_token>"

    Get pvComObject of hoReq to vReq
    Get ComSynchronousRequest Of hoHttp "api.zoom.us" 443 True vReq To vResp
    If (IsComObject(vResp)) Begin
        Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
        Set pvComObject Of hoResp To vResp
    End
    Get ComLastMethodSuccess Of hoHttp To bTemp1
    If (bTemp1 = False) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get Create (RefClass(cComChilkatStringBuilder)) To hoSbResponseBody
    If (Not(IsComObjectCreated(hoSbResponseBody))) Begin
        Send CreateComObject of hoSbResponseBody
    End
    Get pvComObject of hoSbResponseBody to vSbResponseBody
    Get ComGetBodySb Of hoResp vSbResponseBody To iSuccess

    Get Create (RefClass(cComChilkatJsonObject)) To hoJResp
    If (Not(IsComObjectCreated(hoJResp))) Begin
        Send CreateComObject of hoJResp
    End
    Get pvComObject of hoSbResponseBody to vSbResponseBody
    Get ComLoadSb Of hoJResp vSbResponseBody To iSuccess
    Set ComEmitCompact Of hoJResp To False

    Showln "Response Body:"
    Get ComEmit Of hoJResp To sTemp1
    Showln sTemp1

    Get ComStatusCode Of hoResp To iRespStatusCode
    Showln "Response Status Code = " iRespStatusCode
    If (iRespStatusCode >= 400) Begin
        Showln "Response Header:"
        Get ComHeader Of hoResp To sTemp1
        Showln sTemp1
        Showln "Failed."
        Send Destroy of hoResp
        Procedure_Return
    End

    Send Destroy of hoResp

    // Sample JSON response:
    // (Sample code for parsing the JSON response is shown below)

    // {
    //   "registrants": [
    //     {
    //       "registrant_id": "conseret14re",
    //       "email": "example@example.com",
    //       "join_url": " https://zoom.us/w/9999999?tk=oZuwHfdgAAAAAAAAAAAAAAAA&uuid=WN_XW4_SdxBBBBxLDQt"
    //     },
    //     {
    //       "registrant_id": "fdgsfh2ey82fuh",
    //       "email": "example-2@example.com",
    //       "join_url": " https://zoom.us/w/9999999?tk=oZu52542356AAAAAA&uuid=WN_XW4_SdxBBBBxLDQt"
    //     },
    //     {
    //       "registrant_id": "hdsfhjf3iwh",
    //       "email": "example-3@example.com",
    //       "join_url": " https://zoom.us/w/9999999?tk=ozghdfdsghf36AAA&uuid=WN_XW4_SdxBBBBxLDQt"
    //     }
    //   ]
    // }

    // Sample code for parsing the JSON response...
    // Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code

    Move 0 To i
    Get ComSizeOfArray Of hoJResp "registrants" To iCount_i
    While (i < iCount_i)
        Set ComI Of hoJResp To i
        Get ComStringOf Of hoJResp "registrants[i].registrant_id" To sRegistrant_id
        Get ComStringOf Of hoJResp "registrants[i].email" To sEmail
        Get ComStringOf Of hoJResp "registrants[i].join_url" To sJoin_url
        Move (i + 1) To i
    Loop



End_Procedure

Curl Command

curl -X POST
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: multipart/form-data"
	--form 'auto_approve=true'
	--form 'registrants=true[{"first_name":"dolore eu aute dolor","email":"KEESPCs-T1pF@ljUbrzdNgzMc.xx","last_name":"eu reprehenderit ea magna ex"},{"first_name":"aliquip deserunt","email":"okZ9KNk@nZOovoEvyoTCgW.eftt","last_name":"nostrud"}]'
https://api.zoom.us/v2/webinars/:webinarId/batch_registrants

Postman Collection Item JSON

{
  "name": "Perform batch registration",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "POST",
    "header": [
      {
        "key": "Content-Type",
        "value": "multipart/form-data"
      }
    ],
    "body": {
      "mode": "formdata",
      "formdata": [
        {
          "key": "auto_approve",
          "value": "true",
          "description": "If a meeting was scheduled with approval_type `1` (manual approval), but you would like to automatically approve the registrants that are added via this API, you can set the value of this field to `true`. \n\nYou **cannot** use this field to change approval setting for a meeting  that was originally scheduled with approval_type `0` (automatic approval).",
          "type": "text"
        },
        {
          "key": "registrants",
          "value": "[{\"first_name\":\"dolore eu aute dolor\",\"email\":\"KEESPCs-T1pF@ljUbrzdNgzMc.xx\",\"last_name\":\"eu reprehenderit ea magna ex\"},{\"first_name\":\"aliquip deserunt\",\"email\":\"okZ9KNk@nZOovoEvyoTCgW.eftt\",\"last_name\":\"nostrud\"}]",
          "type": "text"
        }
      ]
    },
    "url": {
      "raw": "{{baseUrl}}/webinars/:webinarId/batch_registrants",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "webinars",
        ":webinarId",
        "batch_registrants"
      ],
      "variable": [
        {
          "key": "webinarId",
          "value": "quis officia in reprehenderit",
          "description": "(Required) Unique identifier of the webinar."
        }
      ]
    },
    "description": "Use this API to register up to 30 registrants at once for a scheduled webinar that requires [registration](https://support.zoom.us/hc/en-us/articles/204619915-Scheduling-a-webinar-with-registration). <br>\n\n**Prerequisites:**<br>\n* The webinar host must be a Licensed user.\n* The webinar should be of type `5`, i.e., it should be a scheduled webinar. Other types of webinars are not supported by this API.<br><br>\n**Scope:** `webinar:write`, `webinar:write:admin`<br>\n**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`<br>\n\n\n\n\n\n\n\n"
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `200` **OK** <br>\nRegistrants added.",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "auto_approve",
              "value": "false",
              "description": "If a meeting was scheduled with approval_type `1` (manual approval), but you would like to automatically approve the registrants that are added via this API, you can set the value of this field to `true`. \n\nYou **cannot** use this field to change approval setting for a meeting  that was originally scheduled with approval_type `0` (automatic approval).",
              "type": "text"
            },
            {
              "key": "registrants",
              "value": "[{\"first_name\":\"dolore est dolore ex\",\"email\":\"QlxiFO3fdQ@rzgNRxcC.ijep\",\"last_name\":\"enim consequat veniam commodo\"},{\"first_name\":\"in ut proident adipisicing\",\"email\":\"Fk39rzyimgL2P@MAuNNuZMsxZfijeyYnVHAVxkQ.ipd\",\"last_name\":\"incididunt esse mollit ullamco est\"}]",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/batch_registrants",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "batch_registrants"
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) Unique identifier of the webinar."
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"registrants\": [\n  {\n   \"registrant_id\": \"conseret14re\",\n   \"email\": \"example@example.com\",\n   \"join_url\": \" https://zoom.us/w/9999999?tk=oZuwHfdgAAAAAAAAAAAAAAAA&uuid=WN_XW4_SdxBBBBxLDQt\"\n  },\n  {\n   \"registrant_id\": \"fdgsfh2ey82fuh\",\n   \"email\": \"example-2@example.com\",\n   \"join_url\": \" https://zoom.us/w/9999999?tk=oZu52542356AAAAAA&uuid=WN_XW4_SdxBBBBxLDQt\"\n  },\n  {\n   \"registrant_id\": \"hdsfhjf3iwh\",\n   \"email\": \"example-3@example.com\",\n   \"join_url\": \" https://zoom.us/w/9999999?tk=ozghdfdsghf36AAA&uuid=WN_XW4_SdxBBBBxLDQt\"\n  }\n ]\n}"
    },
    {
      "name": "**HTTP Status Code:** `400` **Bad Request** <br>\n**Error Code:** `200`<br> Webinar plan is missing. You must subscribe to the webinar plan and enable webinar for this user: {0} in order to perform this action.<br><br>\n**Error Code:** `300`<br> \nThis API c",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "auto_approve",
              "value": "false",
              "description": "If a meeting was scheduled with approval_type `1` (manual approval), but you would like to automatically approve the registrants that are added via this API, you can set the value of this field to `true`. \n\nYou **cannot** use this field to change approval setting for a meeting  that was originally scheduled with approval_type `0` (automatic approval).",
              "type": "text"
            },
            {
              "key": "registrants",
              "value": "[{\"first_name\":\"dolore est dolore ex\",\"email\":\"QlxiFO3fdQ@rzgNRxcC.ijep\",\"last_name\":\"enim consequat veniam commodo\"},{\"first_name\":\"in ut proident adipisicing\",\"email\":\"Fk39rzyimgL2P@MAuNNuZMsxZfijeyYnVHAVxkQ.ipd\",\"last_name\":\"incididunt esse mollit ullamco est\"}]",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/batch_registrants",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "batch_registrants"
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) Unique identifier of the webinar."
            }
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTP Status Code:** `404` **Not Found** <br>\n**Error Code:** `3001`<br>\nWebinar does not exist: {0}.<br><br>\n**Error Code:** `3043`<br>\nWebinar has reached maximum attendee capacity.<br><br>\n**Error Code:** `404`<br>\nRegistration has not been enabled fo",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "auto_approve",
              "value": "false",
              "description": "If a meeting was scheduled with approval_type `1` (manual approval), but you would like to automatically approve the registrants that are added via this API, you can set the value of this field to `true`. \n\nYou **cannot** use this field to change approval setting for a meeting  that was originally scheduled with approval_type `0` (automatic approval).",
              "type": "text"
            },
            {
              "key": "registrants",
              "value": "[{\"first_name\":\"dolore est dolore ex\",\"email\":\"QlxiFO3fdQ@rzgNRxcC.ijep\",\"last_name\":\"enim consequat veniam commodo\"},{\"first_name\":\"in ut proident adipisicing\",\"email\":\"Fk39rzyimgL2P@MAuNNuZMsxZfijeyYnVHAVxkQ.ipd\",\"last_name\":\"incididunt esse mollit ullamco est\"}]",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/batch_registrants",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "batch_registrants"
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) Unique identifier of the webinar."
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTP Status Code:** `429` <br> You have exceeded the daily rate limit of \"{0}\" for webinar **Perform batch registration** API requests for the registrant \"{1}\". You can resume these API requests at GMT 00:00:00.",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "auto_approve",
              "value": "false",
              "description": "If a meeting was scheduled with approval_type `1` (manual approval), but you would like to automatically approve the registrants that are added via this API, you can set the value of this field to `true`. \n\nYou **cannot** use this field to change approval setting for a meeting  that was originally scheduled with approval_type `0` (automatic approval).",
              "type": "text"
            },
            {
              "key": "registrants",
              "value": "[{\"first_name\":\"dolore est dolore ex\",\"email\":\"QlxiFO3fdQ@rzgNRxcC.ijep\",\"last_name\":\"enim consequat veniam commodo\"},{\"first_name\":\"in ut proident adipisicing\",\"email\":\"Fk39rzyimgL2P@MAuNNuZMsxZfijeyYnVHAVxkQ.ipd\",\"last_name\":\"incididunt esse mollit ullamco est\"}]",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/batch_registrants",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "batch_registrants"
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) Unique identifier of the webinar."
            }
          ]
        }
      },
      "status": "Too Many Requests",
      "code": 429,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}