I have to combine following 2 JSON files because the API which i use has a limit of 1000.
js1.json:
{
"total": 1311,
"limit": 1000,
"offset": 0,
"data": [
// 1000 Users
]
}
js2.json:
{
"total": 1311,
"limit": 1000,
"offset": 1000,
"data": [
// 311 Users
]
}
What i need:
{
"data": [
// All 1311 Users
]
}
I have seen a few posts where it is written you could just add the JSON files together. But in the end I always get this:
Current PS Code:
$js1 = Invoke-RestMethod 'API Request with offset 0' -Method 'GET' -Headers $headers -Body $body | ConvertTo-Json
$js2 = Invoke-RestMethod 'API Reuqest with offset 1000' -Method 'GET' -Headers $headers -Body $body | ConvertTo-Json
$js1 + $js2 | Out-File -FilePath .\cloudUsers.json