# Can I use JWT to use allow Webinar registration from a form?

**URL:** <https://devforum.zoom.us/t/can-i-use-jwt-to-use-allow-webinar-registration-from-a-form/33327>\
**Category:** API and Webhooks\
**Created:** [October 15, 2020, 9:22am UTC](https://devforum.zoom.us/t/can-i-use-jwt-to-use-allow-webinar-registration-from-a-form/33327 "2020-10-15T09:22:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael.mabini](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael.mabini/32/17002_2.png) [@michael.mabini](https://devforum.zoom.us/u/michael.mabini)\
**Post date:** [October 15, 2020, 9:22am UTC](https://devforum.zoom.us/t/can-i-use-jwt-to-use-allow-webinar-registration-from-a-form/33327/1 "2020-10-15T09:22:11Z")

</div>

**Description**  
I will create an Integration using symphony registration to be integrated to Add Registrant API call

**Error**

**Which App Type (OAuth / Chatbot / JWT / Webhook)?**  
JWT

**Which Endpoint/s?**  
/v2/webinars/{webinarId}/registrants

Question, can I use JWT App to authenticate the registration to our Webinar? Thanks a lot in advance!

---

<div class="post-metadata">

**Author:** ![michael.mabini](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael.mabini/32/17002_2.png) [@michael.mabini](https://devforum.zoom.us/u/michael.mabini)\
**Post date:** [October 16, 2020, 7:04am UTC](https://devforum.zoom.us/t/can-i-use-jwt-to-use-allow-webinar-registration-from-a-form/33327/2 "2020-10-16T07:04:29Z")

</div>

Found a solution on my previous problem/confusion: for others who also having same question kindly see solutions bellow:

Installed JWT Library (for this example I tried using php-jwt from Firebase: you can also check other library from: [https://jwt.io/](https://jwt.io/))

**Install the library:**  
composer require firebase/php-jwt

**Build a JWT App:**

1. 
  - go to [https://marketplace.zoom.us/](https://marketplace.zoom.us/) and Build an APP

2. 
  - Choose JWT

3. 
  - Fill-up all the field needed

4. Use the Credential to the API Integration that is shown bellow

**Create your file to Integrate to the API calls:**

\<?php require\_once 'vendor/firebase/php-jwt/src/BeforeValidException.php'; require\_once 'vendor/firebase/php-jwt/src/ExpiredException.php'; require\_once 'vendor/firebase/php-jwt/src/SignatureInvalidException.php'; require\_once 'vendor/firebase/php-jwt/src/JWT.php'; use \Firebase\JWT\JWT; class Zoom\_Api { private $zoom\_api\_key = 'YOUR\_ZOOM\_API\_APP\_KEY'; private $zoom\_api\_secret = 'YOUR\_ZOOM\_API\_APP\_SECRETE'; protected function sendRequest($data) { $request\_url = 'https://api.zoom.us/v2/webinars/{webinarId}/registrants'; $headers = array( "authorization: Bearer ".$this-\>generateJWTKey(), 'content-type: application/json' ); $postFields = json\_encode($data); $ch = curl\_init(); curl\_setopt($ch, CURLOPT\_HTTPHEADER, $headers); curl\_setopt($ch, CURLOPT\_RETURNTRANSFER,1); curl\_setopt($ch, CURLOPT\_URL, $request\_url); curl\_setopt($ch, CURLOPT\_POST, 1); curl\_setopt($ch, CURLOPT\_POSTFIELDS, $postFields); curl\_setopt($ch, CURLOPT\_SSL\_VERIFYPEER, false); $response = curl\_exec($ch); $err = curl\_error($ch); curl\_close($ch); if(!$response){ return $err; } return json\_decode($response); } //function to generate JWT private function generateJWTKey() { $key = $this-\>zoom\_api\_key; $secret = $this-\>zoom\_api\_secret; $token = array( "iss" =\> $key, "exp" =\> time() + 3600 ); // $token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOm51bGwsImlzcyI6IlI1OWZNMEViUXFPcWNrU0c4dzR2MmciLCJleHAiOjE1OTA1MTM4NDUsImlhdCI6MTU5MDUwODQ0N30.4ch2OZoFM\_vZFdqhoMzJX8r8GPYjKlOkV\_vUa7LprFc"; return JWT::encode( $token, $secret ); } public function registerWebinar( $data = array() ) { $registerToWebinarArray = array(); $registerToWebinarArray['email'] = $data['email']; $registerToWebinarArray['first\_name'] = $data['first\_name'] ; $registerToWebinarArray['last\_name'] = $data['last\_name'] ; $registerToWebinarArray['address'] = $data['address']; $registerToWebinarArray['city'] = $data['city']; return $this-\>sendRequest($registerToWebinarArray); } } $zoom\_meeting = new Zoom\_Api(); $emailRegistrant = $\_POST['email']; $firstNameRegistrant = $\_POST['first\_name']; $lastNameRegistrant = $\_POST['last\_name']; try{ $z = $zoom\_meeting-\>registerWebinar( array( "email" =\> $emailRegistrant, "first\_name" =\> $firstNameRegistrant, "last\_name" =\> $lastNameRegistrant, "address" =\> "", "city" =\> "", "country" =\> "", "zip" =\> "", "state" =\> "", "phone" =\> "", "industry" =\> "", "org" =\> "", "job\_title" =\> "", "purchasing\_time\_frame" =\> "", "role\_in\_purchase\_process" =\> "", "no\_of\_employees" =\> "", "comments" =\> "" ) ); print\_r($z); } catch (Exception $ex) { echo $ex; } ?\>

Note: change the {webinarId} to your own Webinar ID.

I hope this helps to those who are looking for this documentation! Thanks!

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [October 19, 2020, 4:36pm UTC](https://devforum.zoom.us/t/can-i-use-jwt-to-use-allow-webinar-registration-from-a-form/33327/3 "2020-10-19T16:36:35Z")

</div>

Hey @michael.mabini,

It sounds like you were able to figure this out—thanks for sharing your solution!

Best,  
Will

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [November 19, 2020, 2:36am UTC](https://devforum.zoom.us/t/can-i-use-jwt-to-use-allow-webinar-registration-from-a-form/33327/4 "2020-11-19T02:36:35Z")

</div>

Closed on November 19, 2020, 2:36am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
