Description
Im trying to create a user but im not a php expert, I have to do it this way because I have a WordPress site and need to implement PHP, I want to use JWT credentials instead the access token like Zoom API reference shows, Could somebody help me with the code generation using JWT credentials to create a new user, I use a masteraccount to do it
Error
The full error message or issue you are running into.
Which App Type (OAuth / Chatbot / JWT / Webhook)?
JWT
Which Endpoint/s?
Create User
Hey @mateoramos97,
Happy to help—you can use this code snippet to send a request to our Create User endpoint in PHP:
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.zoom.us/v2/users",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"action\":\"create\",\"user_info\":{\"email\":\"dhjdfkghdskjf@fgkjfdlgjfkd.gh\",\"type\":1,\"first_name\":\"Terry\",\"last_name\":\"Jones\"}}",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer {token}",
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Make sure to replace {token} with your JWT token.
Hope this helps!
Best,
Will