# All I want to do is use the API to register an attendee. How?

**URL:** <https://devforum.zoom.us/t/all-i-want-to-do-is-use-the-api-to-register-an-attendee-how/45853>\
**Category:** API and Webhooks\
**Created:** [March 16, 2021, 8:39pm UTC](https://devforum.zoom.us/t/all-i-want-to-do-is-use-the-api-to-register-an-attendee-how/45853 "2021-03-16T20:39:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![seminars](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@seminars](https://devforum.zoom.us/u/seminars)\
**Post date:** [March 16, 2021, 8:39pm UTC](https://devforum.zoom.us/t/all-i-want-to-do-is-use-the-api-to-register-an-attendee-how/45853/1 "2021-03-16T20:39:55Z")

</div>

I’m completely new to Zoom API but have been messing with a couple of API solutions for PHP and JS. Namely “EspressoDev” for PHP and Zoom’s WebSDK for JavaScript. However, I’m unable to find how to simply register an attendee through the API.

We have a website that will allow webinars to be purchased. During the purchase process, we request their name and email address. Upon purchase completion/success, we want to automatically register the attendee to the webinar they just purchased.

This seems like it should be simple, but all I see in the WebSDK is to join a webinar or meeting. We don’t want them to join until the date/time of the event but we want to automatically register them if they’ve purchased.

I’ve created both an OAuth and JWT app in my Zoom account but honestly, I don’t know what is best, necessary, or where to get started.

I think we’ll need this as either a vanilla JS, node JS, or even PHP solution. Any help is appreciated.

Thank you.

---

<div class="post-metadata">

**Author:** ![seminars](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@seminars](https://devforum.zoom.us/u/seminars)\
**Post date:** [March 16, 2021, 9:26pm UTC](https://devforum.zoom.us/t/all-i-want-to-do-is-use-the-api-to-register-an-attendee-how/45853/2 "2021-03-16T21:26:23Z")

</div>

Never mind… finally found this article. Pretty straight forward. Now just need to auto-generate the JWT token.

> **[Add a Webinar Registrant - Webinars - Zoom API - API Reference](https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarregistrantcreate)**
>
> Zoom users with a Webinar Plan have access to creating and managing Webinars. Webinar allows a host to broadcast a Zoom meeting to up to 10,000 attendee...

Thanks anyway.

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [March 16, 2021, 10:55pm UTC](https://devforum.zoom.us/t/all-i-want-to-do-is-use-the-api-to-register-an-attendee-how/45853/3 "2021-03-16T22:55:55Z")

</div>

Hey @seminars,

I’m happy to hear that you answered your question! Feel free to reach out if you encounter any further issues or questions.

Thanks,  
Max

---

<div class="post-metadata">

**Author:** ![seminars](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@seminars](https://devforum.zoom.us/u/seminars)\
**Post date:** [March 17, 2021, 3:11pm UTC](https://devforum.zoom.us/t/all-i-want-to-do-is-use-the-api-to-register-an-attendee-how/45853/4 "2021-03-17T15:11:01Z")

</div>

@MaxM, when trying to set an “Other” expiration date for JWT token, it doesn’t actually change. I saw other posts about this same issue almost a year ago. Will this be fixed?  
 ![Screen Shot 2021-03-17 at 11.07.36 AM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/d/f/dfefa8644239e99cda344813ebaa7aca7ae97582.png)

If not, what is the best method to use for generating a JWT token using PHP from my website?

---

<div class="post-metadata">

**Author:** ![seminars](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@seminars](https://devforum.zoom.us/u/seminars)\
**Post date:** [March 17, 2021, 6:48pm UTC](https://devforum.zoom.us/t/all-i-want-to-do-is-use-the-api-to-register-an-attendee-how/45853/5 "2021-03-17T18:48:15Z")

</div>

@MaxM, why isn’t the “Other” expire setting working?

---

<div class="post-metadata">

**Author:** ![seminars](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@seminars](https://devforum.zoom.us/u/seminars)\
**Post date:** [March 17, 2021, 7:08pm UTC](https://devforum.zoom.us/t/all-i-want-to-do-is-use-the-api-to-register-an-attendee-how/45853/6 "2021-03-17T19:08:50Z")

</div>

So, I’m using Firebase\JWT to generate a token… I then copy the token my script generates (using Firebase) and paste into the debugger at [https://jwt.io](https://jwt.io) and it shows a nice blue “Signature Verified” with checkmark. It’s also showing the correct “iss” value which is my API secret.

However, my cURL script to register an attendee using this generated token produces an error of:  
{“code”:124,“message”:“Invalid access token.”}

This is my code…

```
use Firebase\JWT\JWT;

$key = "myAPIkey";
$payload = array(
    "iss" => "myAPIsecret",
    "exp" => time()+3600, // expire in 1 hours
);

$jwt = JWT::encode($payload, $key, 'HS256');

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.zoom.us/v2/webinars/{WEBINARid}/registrants",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"email\":\"test@test.com\",\"first_name\":\"TestFN\",\"last_name\":\"TestLN\"}",
  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer ".$jwt,
    "content-type: application/json"
  ),
));
```

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [March 18, 2021, 1:32am UTC](https://devforum.zoom.us/t/all-i-want-to-do-is-use-the-api-to-register-an-attendee-how/45853/7 "2021-03-18T01:32:28Z")

</div>

Hey @seminars,

Thank you for your questions.

> [@seminars](#):
>
> when trying to set an “Other” expiration date for JWT token, it doesn’t actually change. I saw other posts about this same issue almost a year ago. Will this be fixed?

Yes, this is something we plan to fix in the near future. In the meantime, you can use the other options or generate a JWT using tools like [JWT.io](http://JWT.io).

> [@seminars](#):
>
> using this generated token produces an error of:  
> {“code”:124,“message”:“Invalid access token.”}

First, please make sure that your server is using a UTC timezone. If that doesn’t help, please send an email to [developersupport@zoom.us](mailto:developersupport@zoom.us) with a link to this thread. In that email, please include an example of a JWT token that has failed in the past.

I’ll investigate the issue further using that information.

Thanks,  
Max

---

<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:** [April 17, 2021, 11:33am UTC](https://devforum.zoom.us/t/all-i-want-to-do-is-use-the-api-to-register-an-attendee-how/45853/8 "2021-04-17T11:33:17Z")

</div>

Closed on April 17, 2021, 11:33am UTC

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