I have spent three days now trying to figure this out and don’t know what else to try. I can use your code above and get a token, but when I attempt to use the token, I get this error:
{“reason”:“Invalid client_id or client_secret”,“error”:“invalid_client”}
The CURL code I’m using to get that error is:
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.zoom.us/v2/webinars/$id/registrants/questions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array( "authorization: Bearer $token" ),
));
(And $token was the result of the getAccessToken above)
When I go to the Developer Page (https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarregistrantsquestionsget) and use that to develop the token, and then use that token string as $token instead, it works on my site. But then the token expires an hour later and it doesn’t work anymore, so I need something that will automatically get the the token.
In reading the documentation about the Oauth process that is required for the API calls I need to make it sounds like the user would need a Zoom account … but that wouldn’t work given that the use case is I want users to my site to be able to fill out a form to register for the webinar, so they woudln’t have a zoom account, I want it to use my account credentials to authenticate and log on, but I can’t do that everytime a user comes to my site and wants to register for a website.
The website is a wordpress site, so I’m trying to create custom PHP functions that will first use the " /webinars/{webinarId}/registrants/questions" API call to get the questions, and then dynamically make a form, and then once submitted I will process the form in a separate PHP handler so I’ll need to have that other call authenticated as well to then use the " /webinars/{webinarId}/panelists" call next.
This seems like such a simple use case, and I’m not sure what to try next.