Issues migrating JWT to Server-to-Server OAuth

Issue migrating JWT to Server-to-Server OAuth

I’m migrating a functionality from JWT to Server-to-Server OAuth.
With JWT the API call registrants works fine.
If in the same call I use the token created with S2S it doesn’t give me any error but it doesn’t record the registration and it doesn’t return a registrant_id.
Any suggestions?

Below is the API call.

curl_setopt_array($curl, array(
CURLOPT_URL => “https://api.zoom.us/v2/” . $IdEventZoom . “/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":"” . $valori[2] . “","first_name":"” . $valori[1] . “","last_name":"” . $valori[0] . “","language":"it-IT","auto_approve":"true"}”,
CURLOPT_HTTPHEADER => array(
"authorization: Bearer ". $token,
“content-type: application/json”
),
));

Based on the provided code snippet, it seems that you are making a POST request to the Zoom API to create a registrant for an event. You mentioned that it works fine with JWT but not with Server-to-Server OAuth. Here are a few suggestions to troubleshoot the issue:

Verify OAuth Token: Ensure that the OAuth token you are using for authentication is valid and has the necessary permissions to create registrants. You can double-check the token generation process and make sure it includes the required scopes.

Check API Endpoint and Event ID: Confirm that the API endpoint is correct and that the IdEventZoom variable holds the correct event ID. Ensure that the event ID is valid and corresponds to an existing event.

Review Request Payload: Check the request payload you are sending in the CURLOPT_POSTFIELDS option. Ensure that the JSON structure is valid and follows the expected format by the Zoom API. Verify that the required fields (email, first_name, last_name) are present and properly formatted.

Error Handling and Response: Capture and print any errors or responses returned by the Zoom API. Check the response code and response body to see if any specific error messages or details are provided. This can help identify any issues or inconsistencies in the API call.

Test with cURL Command: As a troubleshooting step, you can try running the equivalent API call using a cURL command directly in your terminal. This can help isolate any issues related to the code or the SDK you are using.

Consult Zoom API Documentation and Support: Refer to the Zoom API documentation for the specific endpoint (/v2/{IdEventZoom}/registrants) to ensure you are using the correct parameters and headers. If the issue persists, consider reaching out to Zoom API support for further assistance.

By following these suggestions and reviewing the specific details of your implementation, you should be able to identify and resolve the issue with creating registrants using Server-to-Server OAuth.

Regards,
Rachel Gomez

It might also be worth checking the API Call Logs to see if there are any notable differences between the JWT and Server-to-Server OAuth calls that you are making.

Thanks Rachel and Christopher for your suggestions. I’ve made some checks and changed the code from one server to a different one and it works well.