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

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.

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

Thanks anyway.

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

@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

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

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

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 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"
  ),
));

Hey @seminars,

Thank you for your questions.

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.

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 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

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