wizard210
wizard210

Reputation: 1

Invoke-RestMethod -Method Delete Base Request

I'm at a loss. I can run the following and it works flawlessly

Invoke-RestMethod 'https://deerlakes.freshservice.com/api/v2/vendors/13000042524' -Headers $FDHeaders -Method Get

But as soon as I run

Invoke-RestMethod 'https://deerlakes.freshservice.com/api/v2/vendors/13000042524' -Headers $FDHeaders -Method Delete

I get a bad request

Invoke-RestMethod : The remote server returned an error: (400) Bad Request. At line:19 char:1 + Invoke-RestMethod 'https://deerlakes.freshservice.com/api/v2/vendors/ ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

What could I possibly be doing wrong?

Upvotes: 0

Views: 2239

Answers (1)

wizard210
wizard210

Reputation: 1

My problem was that their was a contract associated with the vendor in Freshservice that wouldn't allow me to delete the vendor.

Upvotes: 0

Related Questions