I work for a Microsoft Partner and we are a Cloud Solution Provider. The CSP Program has a wonderful ReST API I would like to turn into a PowerShell module for my personal edification and to easy some of my daily tasks with deploying a ASP.NET website. The problem I have run into is when I call the API via Invoke-RestMethod I get a srtring that kind of looks like a JSON Object but I cant convert it from json. Belwo is my code for the Invoke-Restmethod. Can anyone see an issue with my code here?
Headers match info found here = https://msdn.microsoft.com/en-us/library/partnercenter/mt634673.aspx and the content type is "application/json;charset=utf-8". I tried UseBasicParsing and -UserAgent Parameter as well to no avail.
Invoke-RestMethod -Method Get -Uri 'https://api.partnercenter.microsoft.com/v1/customers?size=40 HTTP/1.1' -Headers $headers3 -ContentType $contentType
I think you have tried the same things as I would have done.
It looks like the response is somehow not really JSON because if it was JSON it would return a PSObject and not just string.
Your response looks equal to the one on the MSDN page, what do you see when you only run
Invoke-RestMethod -Method Get -Uri 'https://api.partnercenter.microsoft.com/v1/customers?size=40