0

I'm hitting an endpoint with this data:

{
  "Id": "variableset-Projects-922",
  "Variables": [
    {
      "Id": "30bf54b6-2e07-100f-d9f4-26879b3e9462",
      "Name": "test",
      "Value": "blah blah",
      "Description": null,
      "Scope": {},
      "IsEditable": true,
      "Prompt": null,
      "Type": "String",
      "IsSensitive": false
    }
  ]
}

Command: $spaces = Invoke-RestMethod -Method 'Get' -Uri $uri -Headers $header

Result: @{Id=variableset-Projects-922; Variables=System.Object[];}

Command: $response = Invoke-WebRequest -URI $uri -Headers $header -Method 'Get' -UseBasicParsing

Result: { "Id": "variableset-Projects-922", "Variables": [] }

Despite testing with | ConvertToJson -Depth 20 the results for the Variables is always coming back as an empty array, what am I missing here?

I am also writing this script inside of a Groovy script in the Jenkins pipeline.

cb32
  • 1
  • 1

1 Answers1

0

Well I figured it out if anyone else comes across a niche problem like this. The API key I was passing had permissions to some of the data, but not all the data.

cb32
  • 1
  • 1