# Getting invalid api key or secret with valid OAuth token

**URL:** <https://devforum.zoom.us/t/getting-invalid-api-key-or-secret-with-valid-oauth-token/13926>\
**Category:** API and Webhooks\
**Created:** [April 19, 2020, 6:35pm UTC](https://devforum.zoom.us/t/getting-invalid-api-key-or-secret-with-valid-oauth-token/13926 "2020-04-19T18:35:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![greg.ross](https://avatars.discourse-cdn.com/v4/letter/g/d9b06d/32.png) [@greg.ross](https://devforum.zoom.us/u/greg.ross)\
**Post date:** [April 19, 2020, 6:35pm UTC](https://devforum.zoom.us/t/getting-invalid-api-key-or-secret-with-valid-oauth-token/13926/1 "2020-04-19T18:35:41Z")

</div>

**Description**  
I am developing a simple app to create a meeting for an authorized user.  
I using OAuth , have create the app and have a valid token with I believe the right credentials [“token\_type”]=\> string(6) “bearer” [“expires\_in”]=\> int(3600) [“scope”]=\> string(13) “meeting:write” }

**Error**  
{“code”:200,“message”:“Invalid api key or secret.”}

**Which App Type (OAuth / Chatbot / JWT / Webhook)?**  
Knowing the endpoint/s can help us to identify your issue faster. Please link the ones you need help/have a question with.

**Which Endpoint/s?**  
[https://api.zoom.us/v2/users/me/meetings](https://api.zoom.us/v2/users/me/meetings)

**How To Reproduce (If applicable)**  
Here is my PHP Code not showing the token

function schedule($token)  
{

$curl = curl\_init();

$post\_data = array(  
‘topic’ =\>“Test Meeting”,  
‘type’ =\> 2,  
‘start\_time’=\>“2020-05-01T10:00:00”,  
‘duration’=\>“60”,  
‘timezone’=\>“America/New\_York”,  
‘password’=\>"",  
‘agenda’=\>"",  
‘settings’=\>array(  
‘host\_video’=\>true,  
‘participant\_video’=\>true,  
‘cn\_meeting’=\>false,  
‘in\_meeting’=\>false,  
‘join\_before\_host’=\>true,  
‘mute\_upon\_entry’=\>false,  
‘watermark’=\>false,  
‘use\_pmi’=\>false,  
‘approval\_type’=\>2,  
‘audio’=\>“both”,  
‘auto\_recording’=\>“none”,  
‘enforce\_login’=\>"",  
‘enforce\_login\_domains’=\>"",  
‘alternative\_hosts’=\>""  
)  
);  
$header = array(“Authorization: Bearer {$token}”, “Content-Type: application/json”);

curl\_setopt\_array($curl, array(  
CURLOPT\_URL =\> “[https://api.zoom.us/v2/users/me/meetings](https://api.zoom.us/v2/users/me/meetings)”,  
CURLOPT\_RETURNTRANSFER =\> true,  
CURLOPT\_ENCODING =\> “”,  
CURLOPT\_MAXREDIRS =\> 10,  
CURLOPT\_TIMEOUT =\> 1000,  
CURLOPT\_HTTP\_VERSION =\> CURL\_HTTP\_VERSION\_1\_1,  
CURLOPT\_CUSTOMREQUEST =\> “POST”,  
CURLOPT\_POSTFIELDS =\> json\_encode($post\_data),  
CURLOPT\_HTTPHEADER =\> $header  
));  
$res1 = curl\_exec($curl);  
echo “  
”;  
print\_r($res1);  
}

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [April 21, 2020, 1:49am UTC](https://devforum.zoom.us/t/getting-invalid-api-key-or-secret-with-valid-oauth-token/13926/2 "2020-04-21T01:49:06Z")

</div>

Hey @greg.ross,

It looks like you are using a [Chatbot Token via the Chatbot Auth Flow](https://marketplace.zoom.us/docs/guides/chatbots/installation-and-authentication#authentication) instead of an [OAuth Token via the OAuth flow](https://marketplace.zoom.us/docs/guides/auth/oauth).

Please follow the [OAuth flow to get an access\_token](https://marketplace.zoom.us/docs/guides/auth/oauth) and it should work! 🙂

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 8:50pm UTC](https://devforum.zoom.us/t/getting-invalid-api-key-or-secret-with-valid-oauth-token/13926/3 "2020-08-21T20:50:38Z")

</div>

Closed on August 21, 2020, 8:50pm UTC


