on-internet
← Community

How to parse RESTful API response with powershell that doesn't have key defined of the array

Stack Overflow ·

I'm writing a powershell script to call a RESTful API and I need to parse the response. I'm having trouble parsing the response because there isn't a key name to the array. The API just returns contents of an array: [ { "ProfileId": "b9b4bf0b-fea3-4464-af91-b79b521d36ba", "SourcePhoneNumber": "8880001111", "FirstName": "Peter" }, { "ProfileId": "b9b4bf1b-cta3-4464-af91-b68c521d36ba", "SourcePhoneNumber": "8660001111", "FirstName": "Fred" } ] Here's how I'm calling the API and getting the response: $headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]" $headers.Add("co

Comments

Sign in or sign up to comment and upvote.

No comments yet.