How to update meeting with PHP?

Description
I’m unclear on how to set up PHP to update meeting parameters.

Error
Not an error. Just returns meeting description without changing anything. Do I need to provide all the settings?

Which App Type)?
JWT

Which Endpoint/s?
Knowing the API endpoint/s can help us to identify your issue faster. Please link the ones you need help/have a question with.

https://api.zoom.us/v2/meetings/” . $MeetingID;

How To Reproduce (If applicable)
Steps to reproduce the behavior: Here’s my code:

$arrData = [‘topic’ => ‘API changed the topic to this’];
$jsonData = json_encode($arrData,true);

$URL = "https://api.zoom.us/v2/meetings/" . $MeetingID;
$ch = curl_init($URL);
$customHeaders = array(
    'Authorization:Bearer ' . $gZoomToken,
    'Content-type:application/json,');
curl_setopt($ch, CURLOPT_HTTPHEADER, $customHeaders);
curl_setopt($ch, CURLOPT_ACCCEPT, "application/json");
curl_setopt($ch, CURLOPT_GET, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_GETFIELDS, $jsonData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

//Execute the request.
$Result = curl_exec($ch);
$Response .= “|” . $Result;

Screenshots (If applicable)
If applicable, add screenshots to help explain your problem.

Additional context
I’ve made sure the meeting ID I’m testing with is not my personal meeting ID. I can get the list of meetings okay, so the JWT token seems to be okay.

Hi,

You need to submit a POST request and not a GET request, specifically a PATCH request as per the documentation: https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingupdate

    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");

Furthermore you need to use CURLOPT_POSTFIELDS instead of _GETFIELDS.

Also there is a typo in “CURLOPT_ACCCEPT” which is not even a valid CURL option I think. Same for CURLOPT_GET. And there seems to be an extra “,” in your Content-type header at the end.

Willem

1 Like

Thank you Willem,

It worked! A lot of my dumb mistakes. But where in the documentation does it say that it needs to be POST and PATCH?

Reg

1 Like

Right at the top for instance!

reg1
June 14 |

  • | - |

Thank you Willem,

It worked! A lot of my dumb mistakes. But where in the documentation does it say that it needs to be POST and PATCH?

Reg


Visit Topic or reply to this email to respond.


In Reply To

willem
June 14 |

  • | - |

Hi, You need to submit a POST request and not a GET request, specifically a PATCH request as per the documentation: https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingupdate curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “PATCH”); Furthermore you need to use CURLOPT_POSTFIELDS i…


Visit Topic or reply to this email to respond.

To unsubscribe from these emails, click here.

Infolearn

1 Like

Duh! Too obvious. :frowning: Thanks again.

Also, it wasn’t readily apparent that there are examples available in the Test Request at the bottom. That sounds like what I was looking for all along.

I’m still struggling a bit to make it work: it doesn’t seem to like my email address as a user ID and it’s still unclear where to find the id that it wants.

Reg

PS. I know you guys are super busy, so I really appreciate the promptness of your replies.

Hey @reg1,

Please provide the request URL, request body JSON, and error message so I can help. :slight_smile:

Also thanks for your help @willem! :slight_smile:

Thanks,
Tommy

Thanks Tommy,

As you’ve probably gathered from my blunders, even though a long time developer, I’m new to both the Zoom API and Curl, so I’m still working on developing a basic knowledge of how to use this API.

It looks like the >Send at the bottom of each request type can show the PHP examples I need. But when I click “Get Access Token”, it asks for a client ID. It’s unclear where to find that. (I”m using JWT; I’m guessing that it might be buried somewhere in the token.)

Reg

1 Like

Hey @reg1,

No worries! :slight_smile:

For using JWT and the Send a Test Request feature, just past in the JWT Token as the oauth_access_token value like so:

Thanks,
Tommy