# PSZoom module error

**URL:** <https://devforum.zoom.us/t/pszoom-module-error/57250>\
**Category:** API and Webhooks\
**Created:** [September 10, 2021, 4:35pm UTC](https://devforum.zoom.us/t/pszoom-module-error/57250 "2021-09-10T16:35:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajaya](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@ajaya](https://devforum.zoom.us/u/ajaya)\
**Post date:** [September 10, 2021, 4:35pm UTC](https://devforum.zoom.us/t/pszoom-module-error/57250/1 "2021-09-10T16:35:32Z")

</div>

**Description**  
I created a script that will remove users from my corporate zoom account. When testing the script from my laptop, it works great. But when I try to run the script from a server we use for scheduled tasks, I get an error. I’ve installed the same PSZoom module on the server and call it at the top of my script.

**Error**  
Invoke-ZoomRestMethod : The remote server returned an error: (400) Bad Request. Invalid api key or secret.  
At C:\Program Files\WindowsPowerShell\Modules\PSZoom\1.15.0.0\Public\Users\Get-ZoomUser.ps1:103 char:25

- … $response = Invoke-ZoomRestMethod -Uri $request.Uri -Headers ([ref]$H …
- 

```
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

```

  - CategoryInfo : InvalidOperation: ([https://api.zoo](https://api.zoo)…orthepeople.com:) [Write-Error], Invalid api key or secret.
  - FullyQualifiedErrorId : 400,Invoke-ZoomRestMethod

**Which App Type (OAuth / Chatbot / JWT / Webhook)?**  
I’m using a JWT authentication method

**Additional context**  
Import-Module PSZoom  
Get-ZoomUser -UserId ‘user@domain.com’ -ApiKey $ApiKey -ApiSecret $ApiSecret

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [September 13, 2021, 4:07pm UTC](https://devforum.zoom.us/t/pszoom-module-error/57250/2 "2021-09-13T16:07:21Z")

</div>

Hi @ajaya,

Which Zoom REST endpoint are you calling in your script (can you share the request URL)? Do you run into the same issue when testing using cURL, Postman, etc.?

Thanks,  
Will

---

<div class="post-metadata">

**Author:** ![ajaya](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@ajaya](https://devforum.zoom.us/u/ajaya)\
**Post date:** [September 13, 2021, 4:33pm UTC](https://devforum.zoom.us/t/pszoom-module-error/57250/3 "2021-09-13T16:33:52Z")

</div>

I was using the rest zoom endpoint wrapped in the PSZoom power shell module.

I decided not to use it since testing with postman was successful with an extended JW token.

**Alex Jaya**  
Systems Engineer

[![](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/3/3/331bad32bd66aae296de78d54cbcb796a21e1484.jpeg)](https://www.forthepeople.com/?utm_source=signature&utm_medium=email)

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [September 16, 2021, 2:30pm UTC](https://devforum.zoom.us/t/pszoom-module-error/57250/4 "2021-09-16T14:30:14Z")

</div>

I see, thanks for confirming!

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [September 16, 2021, 2:30pm UTC](https://devforum.zoom.us/t/pszoom-module-error/57250/5 "2021-09-16T14:30:16Z")

</div>


