# API Call POST Method with powershell seems not be working

**URL:** <https://devforum.zoom.us/t/api-call-post-method-with-powershell-seems-not-be-working/67385>\
**Category:** API and Webhooks\
**Created:** [April 11, 2022, 2:47pm UTC](https://devforum.zoom.us/t/api-call-post-method-with-powershell-seems-not-be-working/67385 "2022-04-11T14:47:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dennis.raulien](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dennis.raulien/32/36780_2.png) [@dennis.raulien](https://devforum.zoom.us/u/dennis.raulien)\
**Post date:** [April 11, 2022, 2:47pm UTC](https://devforum.zoom.us/t/api-call-post-method-with-powershell-seems-not-be-working/67385/1 "2022-04-11T14:47:07Z")

</div>

## Invoke-RestMethod: “POST” end in unclear error message

**Description**  
I am executing the following commands:

$headers = New-Object “System.Collections.Generic.Dictionary[[String],[String]]”  
$headers.Add(‘Content-Type’ , $contentType)  
$headers.Add(‘Authorization’,'Bearer ’ + $token)  
$base\_uri = “[https://api.zoom.us/v2](https://api.zoom.us/v2)”  
$phoneID=$phone\_site\_detail.id  
$body = @{  
“description” = “Testtemplate for phone users”  
“name” = “Phone User Template”  
“site\_id” = $phoneID  
“type” = “user”  
} | ConvertTo-Json

Invoke-RestMethod -uri $base\_uri+“/phone/setting\_templates” -Method POST -Body $body -Headers $headers -ContentType “application/json”

**As a result I am receiving the following (not real) Error / Information message**  
Invoke-RestMethod:  
window.zmGlobalMrktId = “5fda3c08cc144b719072d9\*\*\*\*\*\*\*\*\*\*” || null;  
window.zmGlobalMrktKey = “” || null;  
Page Not Found - Zoom  
var resourceAccountIdRoutingURl = “”;  
resourceAccountIdRoutingURl = resourceAccountIdRoutingURl==“”?undefined:resourceAccountIdRoutingURl;  
var \_market\_OneTrust\_CookieArray = ;  
\_market\_OneTrust\_CookieArray.push({name: “\_zm\_tracking\_guid”, value: “a644c1cce40a4445a5f8668b6bbe0c4e”});  
var \_zm\_cookie\_domain = “.zoom.us”;  
body div.combobox div.dropdownlist{  
width: calc(100% + 2px) !important;  
}

And the output in general is much longer than i have space here, but these are the first and seems to be the most important ones.

**Which App Type (OAuth / Chatbot / JWT / Webhook)?**  
JWT

**Which Endpoint/s?**  
[https://api.zoom.us/v2/phone/setting\_templates](https://api.zoom.us/v2/phone/setting_templates)

**How To Reproduce (If applicable)**  
Steps to reproduce the behavior:

1. Invoke-RestMethod -uri $base\_uri+“/phone/setting\_templates” -Method POST -Body $body -Headers $headers -ContentType “application/json”
2. window.zmGlobalMrktKey = “” || null;

**Additional context**  
$token, $phone\_site\_detail.id and the access via JWT in general is working, because I am getting all expected information with the RestAPI GET Method.

**Does anyone has some ideas, what i am doing wrong here?**

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [April 12, 2022, 1:51pm UTC](https://devforum.zoom.us/t/api-call-post-method-with-powershell-seems-not-be-working/67385/2 "2022-04-12T13:51:19Z")

</div>

Hi @dennis.raulien

Hope you are doing great and welcome to our community!  
Allow me some time to try and replicate this error on my end and I will come back to you shortly!  
Best,  
Elisa

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [April 21, 2022, 4:03pm UTC](https://devforum.zoom.us/t/api-call-post-method-with-powershell-seems-not-be-working/67385/3 "2022-04-21T16:03:27Z")

</div>

Hey there!  
@dennis.raulien

Thanks for your patience. I have not been able to replicate this error on my end.  
Could you please make sure that you are passing application/json as the contentType?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [May 22, 2022, 2:03am UTC](https://devforum.zoom.us/t/api-call-post-method-with-powershell-seems-not-be-working/67385/4 "2022-05-22T02:03:37Z")

</div>

Closed on May 22, 2022, 2:03am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
