Creating users by Curl post /users giving error "Invalid access token" and code 124

API endpoint: post /users
Hi, I want to create new user for Zoom Meeting API by curl. I have created Client ID and Client Secret and made the header as base64_encode(CLIENT_ID.‘:’.CLIENT_SECRET);

“Invalid access token” and code 124.

$auth = base64_encode(CLIENT_ID.‘:’.CLIENT_SECRET);

$json_data = ‘[
“action” => “create”,
“email” => “symapptest10@gmail.com”,
“type” => 1,
]’;

curl_setopt($ch, CURLOPT_URL, ‘https://api.zoom.us/v2/users/’);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);

$headers = array();
$headers = ‘Authorization: Basic ‘.$auth.’’;
$headers = ‘Content-Type: application/json’;
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);

Please suggest what is the problem and what may be the solution.

Hi @symapptest3 ,

The authentication that you are using is Basic, you should be using the “Bearer Token” instead.

Here are the steps to make an API call in Zoom:

  1. Generate an Access Token
    Refer: OAuth with Zoom or
    Create a Server-to-Server OAuth app

  2. Use the access token to make the API call.
    Refer: OAuth with Zoom

Let me know if this helps