Uneable create meeting with REST API

Hi everyone!

I can get the list users and meetings, but when I try create a new meeting or user I can´t.

My code in PHP is:

$ch = curl_init('https://api.zoom.us/v2/meetings');	
$d= array(
    "topic" => "AKIMA",
    "type" => "2",
    "timezone" => "America/Mexico_City",
    "start_time" => "2018-12-01T11:00:00Z",
    "duration" => "5",
    "settings" => array(
                 "auto_recording" => "local"
                )
      );
$d = json_encode($d);
echo $d . '<br \>';
curl_setopt($ch, CURLOPT_POST, 1);	
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($ch, CURLOPT_POSTFIELDS, $d);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . generateJWT(),
"Content-Type: application/json"));

$response = curl_exec( $ch );
$response = json_decode( $response );

My JSON string is:

{
“topic”:“AKIMA”,
“type”:“2”,
“timezone”:“America/Mexico_City”,
“start_time”:“2018-12-01T11:00:00Z”,
“duration”:“5”,
“settings”:
{
“auto_recording”:
“local”
}
}

When I run the program the query does not bring anything, no error, it comes empty

If I try using JavaScript with the next code:

var arr = { action: ‘create’, user_info: { email: ‘pedro.x@abc.com.mx’, type: 1, first_name: ‘Pedro’, last_name: ‘X’, password: ‘123ABC’ } };
$.ajax({
url : ‘https://api.zoom.us/v2/users?access_token=XXX’,
data : arr,
method : ‘POST’,
dataType : ‘jsonp’,
jsonpCallback: ‘apiStatus’,
success: function( msg ) {
console.log(‘callback success’);
},
error: function( jqXhr, textStatus, errorThrown ) {
console.log( errorThrown );
}
});

	        window.jsonpCallback = function(response) {
			    console.log('callback success');
			};

The program Show me the error:

jQuery1830649454693285679_1359620502896 was not called JSON

But the request brings me the user list:
{
“page_count”:1,
“page_number”:1,
“page_size”:30,
“total_records”:1,
“users”:[
{"
id":“lIezVG0qST-XX”,
“first_name”:“Jorge”,
“last_name”:“Y”,
“email”:“jorge.y@abc.com.mx”,
“type”:1,
“pmi”:27504XXX,
“timezone”:“America/Mexico_City”,
“verified”:1,
“created_at”:“2018-11-23T18:38:41Z”,
“last_login_time”:“2018-11-23T18:38:41Z”
}]
}

Can you help me, please.

Hi @jorge.juarez,

Your payload looks correct, have you tried making the same API call using Curl or Postman?

Thanks

@jorge.juarez It looks like the PHP is using PATCH, which is the “Update a meeting” method.

The “Create a meeting” method is:
POST https://api.zoom.us/v2/users/{userId}/meetings

1 Like

Great catch @Jonathan_Champ!