ZOOM REST API call always resulting in Error 124 "Invalid Access Token"

Greetings - I am trying to call a REST API method from within my PHP code (for a wordpress website).

The REST API method is “Add Meeting Registrant” or /meetings/{meetingId}/registrants
I have created a valid JSON web token using the JWT.IO library (Firebase) and validated it on the JWT.io validation page.

Then I setup rest of the information needed for that API call and use the ZOOM example curl code to make the call. But no matter what I do I keep getting a Code:124 “Invalid Access Token” back as the response object.

1st Question: Does this particular API method support JWT authentication?
2nd Question: Is it working or are there any known issues using JWT for this API method call?

I cannot post my code here BUT I have emailed it to developersupport@zoom.us so that you can take a look at it further. The code looks right to me - wondering if it’s something going on, on the ZOOM side that’s causing this error?

Thanks in advance! - Mark

Hi @mbeede,

I just tested the API using a JWT token in our Documentation, and it worked correctly for me.

Can you please try the following:

  1. Visit the add meeting registrant API in our Docs

  2. Where it says " oauth_access_token", paste the JWT token that you receive in your code

  1. If the JWT token works for that meeting ID in the documentation, please let me know, if not then the token that you are receiving is invalid. I would recommend you to check your API key and Secret again.

Let me know if this helps.

Thanks,
Ojus

I ran this test. I verified the JWT with jwt.io. When I send a test request I am still getting the same error 124 “Invalid Access Token”
AND I have checked and checked again the KEY and SECRET and they are both correct.
I sent you a lot more details via email to developersupport@zoom.us.
PLEASE see if you can determine what I am missing, or what I am doing different that you did.

Thanks, Mark

Hi @mbeede,

I responded to you via email. Also we are currently updating our JWT documentation. I am hoping to have an update for you by monday. Thank you for waiting.

Thanks

Ojus - I followed the instructions per your email. When I went into the marketplace, created the new temp app, it created a different KEY and SECRET than the one’s that are in “settings” for this ZOOM account. So I tried that KEY and SECRET and IT WORKED! THANKS!

But now I am getting an “Invalid MeetingId” message. In this account there is a meeting called “Mark Test Meeting” with Meeting Id “653-070-246”. So I have tried both of these URLs:

So with and without the dashes. Do I need to place the Meeting ID in any of the data that I pass into this REST API call, or is it just used in the URL? I’m not sure why I am getting the “Invalid MeetingID” returned from the REST API call. Can you help?

Thanks - Mark

@mbeede was it an instant meeting without your PMI? If yes can you try it with a scheduled meeting or one with your PMI?

I created just a standard scheduled meeting and when I was done it gave me a unique Meeting ID. So I am not using the Personal Meeting ID (this option is unchecked). So it looks like this:

Shouldn’t I be able to just use this meeting ID? Does this help?

There’s a different meeting ID that looks like “wILdStr1nG5=0mY” and I think that’s the one the API needs. In the forum, if you search for “double encode”, there’s a few examples.

I have looked all over my meeting setup screen and I don’t see this other Meeting ID anywhere.

Is there a 2nd meeting ID (if so where can I find it?) OR do I just encode the 653-070-246 primary ID?

Thanks, Mark

The encoding would be URL encoding, but numbers and hyphens don’t change with URL encoding, so that shouldn’t be the problem.

The UUID is the value that I was thinking of. I think you can get it using the “List Meetings” API call:

The documentation for the registrants and meeting API calls say “integer” for the meetingId, so I would expect it wants the number with no hyphens. I’ll run a test on my setup.

In my testing, the meetingId must be an integer. When I tested with the registrants API call, it correctly gave me the error “This meeting has not registration required”.

An interesting side note for 32-bit systems: The Meeting ID can overflow a 32-bit integer on Personal Meeting IDs higher than 214-748-3647. In those situations, you may want to treat the integers 2147483648 and higher as a string.

OK - So I called the List Meetings API call and got back a JSON string of this type (I’m using PHP BTW)

Now once I have the JSON string I presume I need to convert it into a PHP class object that looks like the above, with an array of meeting objects inside it. That way I can iterate over array of meetings and find the one that I want. Do you have these objects already defined in PHP classes (code) somewhere, or do I just create PHP classes that look like these objects myself? In other words how do I go about taking that giant JSON string and reworking it so I can pull certain meetings and ID’s from it? Can you point me to some PHP code perhaps?

Thanks in advance - Mark

https://www.php.net/manual/en/function.json-decode.php

If you like arrays:

$result = json_decode($response, true);
return $result['meetings'];

If you like objects:

$result = json_decode($response);
return $result->meetings;

There’s some complicated stuff you can do with pages, but as long as page_count is 1, there’s only one page to look at. You may want to make sure you are sending page_size 300 in your request so that you don’t have to make as many requests to get all of the data. Of course, if you only want a small number of results returned, setting the page_size lower will result in faster responses.

The Meeting UUID seems to only be used in other function calls like past_meetings/{meeting_uuid}. By default, they mean Meeting ID, which is in the 'id' field in the 'meetings' array.

That seems like it should work. You could also use a foreach, as in:

foreach ($meetingList as $meetingItem) {
    echo $meetingItem->id, PHP_EOL;
}

@Jonathan_Champ Thank you for being such a valued member in our community!

1 Like