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

**URL:** <https://devforum.zoom.us/t/zoom-rest-api-call-always-resulting-in-error-124-invalid-access-token/4800>\
**Category:** API and Webhooks\
**Created:** [June 27, 2019, 11:32pm UTC](https://devforum.zoom.us/t/zoom-rest-api-call-always-resulting-in-error-124-invalid-access-token/4800 "2019-06-27T23:32:40Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbeede](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@mbeede](https://devforum.zoom.us/u/mbeede)\
**Post date:** [June 27, 2019, 11:32pm UTC](https://devforum.zoom.us/t/zoom-rest-api-call-always-resulting-in-error-124-invalid-access-token/4800/1 "2019-06-27T23:32:40Z")

</div>

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](http://JWT.IO) library (Firebase) and validated it on the [JWT.io](http://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](mailto: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

---

<div class="post-metadata">

**Author:** ![ojus.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ojus.zoom/32/734_2.png) [@ojus.zoom](https://devforum.zoom.us/u/ojus.zoom)\
**Post date:** [June 28, 2019, 7:41pm UTC](https://devforum.zoom.us/t/zoom-rest-api-call-always-resulting-in-error-124-invalid-access-token/4800/2 "2019-06-28T19:41:05Z")

</div>

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](https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrantcreate) in our Docs

2. Where it says " **oauth\_access\_token",** paste the JWT token that you receive in your code

 ![](https://zoomus.zendesk.com/attachments/token/WUzMY0lkLqXMCxNWH5cOX0EGN/?name=inline1429541687.png) **​**

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

---

<div class="post-metadata">

**Author:** ![mbeede](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@mbeede](https://devforum.zoom.us/u/mbeede)\
**Post date:** [June 28, 2019, 10:22pm UTC](https://devforum.zoom.us/t/zoom-rest-api-call-always-resulting-in-error-124-invalid-access-token/4800/3 "2019-06-28T22:22:09Z")

</div>

I ran this test. I verified the JWT with [jwt.io](http://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](mailto:developersupport@zoom.us).  
PLEASE see if you can determine what I am missing, or what I am doing different that you did.

Thanks, Mark

---

<div class="post-metadata">

**Author:** ![ojus.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ojus.zoom/32/734_2.png) [@ojus.zoom](https://devforum.zoom.us/u/ojus.zoom)\
**Post date:** [June 28, 2019, 10:39pm UTC](https://devforum.zoom.us/t/zoom-rest-api-call-always-resulting-in-error-124-invalid-access-token/4800/4 "2019-06-28T22:39:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mbeede](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@mbeede](https://devforum.zoom.us/u/mbeede)\
**Post date:** [June 28, 2019, 10:54pm UTC](https://devforum.zoom.us/t/zoom-rest-api-call-always-resulting-in-error-124-invalid-access-token/4800/5 "2019-06-28T22:54:26Z")

</div>

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 “\*\*\*\*\*\*\*\*\*\*\*”. So I have tried both of these URLs:

- [https://api.zoom.us/v2/meetings/653-070-246/registrants](https://api.zoom.us/v2/meetings/653-070-246/registrants)
- [https://api.zoom.us/v2/meetings/653070246/registrants](https://api.zoom.us/v2/meetings/653070246/registrants)

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

\*This post has been edited to remove any meeting / webinar IDs

---

<div class="post-metadata">

**Author:** ![ojus.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ojus.zoom/32/734_2.png) [@ojus.zoom](https://devforum.zoom.us/u/ojus.zoom)\
**Post date:** [June 28, 2019, 10:58pm UTC](https://devforum.zoom.us/t/zoom-rest-api-call-always-resulting-in-error-124-invalid-access-token/4800/6 "2019-06-28T22:58:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mbeede](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@mbeede](https://devforum.zoom.us/u/mbeede)\
**Post date:** [June 28, 2019, 11:10pm UTC](https://devforum.zoom.us/t/zoom-rest-api-call-always-resulting-in-error-124-invalid-access-token/4800/7 "2019-06-28T23:10:25Z")

</div>

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:

 ![ZoomMeeting](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/5/590a5bd520df716f7ebdc43d0b680cc096fe78e4.jpeg)

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

---

<div class="post-metadata">

**Author:** ![Jonathan\_Champ](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jonathan_champ/32/45_2.png) [@Jonathan\_Champ](https://devforum.zoom.us/u/Jonathan_Champ)\
**Post date:** [June 29, 2019, 4:01pm UTC](https://devforum.zoom.us/t/zoom-rest-api-call-always-resulting-in-error-124-invalid-access-token/4800/8 "2019-06-29T16:01:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mbeede](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@mbeede](https://devforum.zoom.us/u/mbeede)\
**Post date:** [July 1, 2019, 2:08pm UTC](https://devforum.zoom.us/t/zoom-rest-api-call-always-resulting-in-error-124-invalid-access-token/4800/9 "2019-07-01T14:08:10Z")

</div>

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 \*\*\*\*\*\*\*\*\*\*\* primary ID?

Thanks, Mark

\*This post has been edited to remove any meeting / webinar IDs

---

<div class="post-metadata">

**Author:** ![Jonathan\_Champ](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jonathan_champ/32/45_2.png) [@Jonathan\_Champ](https://devforum.zoom.us/u/Jonathan_Champ)\
**Post date:** [July 1, 2019, 6:02pm UTC](https://devforum.zoom.us/t/zoom-rest-api-call-always-resulting-in-error-124-invalid-access-token/4800/10 "2019-07-01T18:02:03Z")

</div>

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:

> **[List Meetings - Meetings - Zoom API - API Reference](https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetings)**
>
> List meetings for a user.
> Scopes: meeting:read:admin meeting:read
> 
> Authorization
> 
> Request Parameters
> 
> Responses
> 
> Send a Test Request

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.

---

<div class="post-metadata">

**Author:** ![Jonathan\_Champ](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jonathan_champ/32/45_2.png) [@Jonathan\_Champ](https://devforum.zoom.us/u/Jonathan_Champ)\
**Post date:** [July 1, 2019, 6:43pm UTC](https://devforum.zoom.us/t/zoom-rest-api-call-always-resulting-in-error-124-invalid-access-token/4800/11 "2019-07-01T18:43:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mbeede](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@mbeede](https://devforum.zoom.us/u/mbeede)\
**Post date:** [July 2, 2019, 12:15am UTC](https://devforum.zoom.us/t/zoom-rest-api-call-always-resulting-in-error-124-invalid-access-token/4800/13 "2019-07-02T00:15:28Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/7/7c75bc1b0860b55868164d1c26b838d80cb143f5.png)

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

---

<div class="post-metadata">

**Author:** ![Jonathan\_Champ](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jonathan_champ/32/45_2.png) [@Jonathan\_Champ](https://devforum.zoom.us/u/Jonathan_Champ)\
**Post date:** [July 2, 2019, 2:47am UTC](https://devforum.zoom.us/t/zoom-rest-api-call-always-resulting-in-error-124-invalid-access-token/4800/14 "2019-07-02T02:47:05Z")

</div>

[https://www.php.net/manual/en/function.json-decode.php](https://www.php.net/manual/en/function.json-decode.php)

If you like arrays:

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

```

If you like objects:

```auto
$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.

---

<div class="post-metadata">

**Author:** ![Jonathan\_Champ](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jonathan_champ/32/45_2.png) [@Jonathan\_Champ](https://devforum.zoom.us/u/Jonathan_Champ)\
**Post date:** [July 2, 2019, 9:16pm UTC](https://devforum.zoom.us/t/zoom-rest-api-call-always-resulting-in-error-124-invalid-access-token/4800/16 "2019-07-02T21:16:40Z")

</div>

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

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

```

---

<div class="post-metadata">

**Author:** ![ojus.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ojus.zoom/32/734_2.png) [@ojus.zoom](https://devforum.zoom.us/u/ojus.zoom)\
**Post date:** [July 16, 2019, 4:13am UTC](https://devforum.zoom.us/t/zoom-rest-api-call-always-resulting-in-error-124-invalid-access-token/4800/17 "2019-07-16T04:13:58Z")

</div>

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