Hi When I use the Get Devices, I only get 10 devices althoug my tenant has 888 devices, how can I retrieve all devices ?
Hello,
We want to extract all the Devices in our Tenant with this URL : people-and-device-inventory.ivanti.rapidapi.com
Our script is fully functionnal but we have 57K endpoints to extract. It took more than 1 hour to extract with the API Request Limitation (150/minute).
Is it possible to extend the token to 2 hour ?
Thank you.
Did you ever get this working? Have you ran into issues with the bearer token expiring?
I believe I found the solution:
headers=@headers=@{} headers=@headers.Add(“X-TenantId”, “XXXX”) headers.Add("X−ClientSecret","XXXX")headers.Add("X-ClientSecret", "XXXX") headers.Add("X−ClientSecret","XXXX")headers.Add(“X-ClientId”, “XXXXX”) headers.Add("X−RapidAPI−Key","XXXXXX)headers.Add("X-RapidAPI-Key", "XXXXXX) headers.Add("X−RapidAPI−Key","XXXXXX)headers.Add(“X-RapidAPI-Host”, “people-and-device-inventory.ivanti.rapidapi.com”)
$key = Invoke-RestMethod -Uri ‘https://people-and-device-inventory.p.rapidapi.com/api/apigatewaydataservices/v1/Token’ -Method GET -Headers $headers
headers=@headers=@{} headers=@headers.Add(“Authorization”, "Bearer key")key") key")headers.Add(“X-RapidAPI-Key”, “XXXXXXX”) headers.Add("X−RapidAPI−Host","people−and−device−inventory.ivanti.rapidapi.com")headers.Add("X-RapidAPI-Host", "people-and-device-inventory.ivanti.rapidapi.com") headers.Add("X−RapidAPI−Host","people−and−device−inventory.ivanti.rapidapi.com")response = Invoke-RestMethod -Uri ‘https://people-and-device-inventory.p.rapidapi.com/api/apigatewaydataservices/v1/devices’ -Method GET -Headers $headers
all=@()all = @() all=@()all+=$response.value
while($response.’@odata.nextLink’ -ne $null) { $response = Invoke-RestMethod $response.’@odata.nextLink’ -Method Get -Headers $Headers $all += $response.value }
$all | ConvertTo-Json -Depth 100 | Out-File “c:\temp\devices.json”
Does this sound right ?
Join in the discussion - add comment below:
Hello,
We want to extract all the Devices in our Tenant with this URL : people-and-device-inventory.ivanti.rapidapi.com
Our script is fully functionnal but we have 57K endpoints to extract. It took more than 1 hour to extract with the API Request Limitation (150/minute).
Is it possible to extend the token to 2 hour ?
Thank you.
Did you ever get this working? Have you ran into issues with the bearer token expiring?
I believe I found the solution:
Neurons devices
Get API token
headers=@headers.Add(“X-TenantId”, “XXXX”)
headers.Add("X−ClientSecret","XXXX")headers.Add(“X-ClientId”, “XXXXX”)
headers.Add("X−RapidAPI−Key","XXXXXX)headers.Add(“X-RapidAPI-Host”, “people-and-device-inventory.ivanti.rapidapi.com”)
$key = Invoke-RestMethod -Uri ‘https://people-and-device-inventory.p.rapidapi.com/api/apigatewaydataservices/v1/Token’ -Method GET -Headers $headers
Connection details to rapidApi
headers=@headers.Add(“Authorization”, "Bearer key")headers.Add(“X-RapidAPI-Key”, “XXXXXXX”)
headers.Add("X−RapidAPI−Host","people−and−device−inventory.ivanti.rapidapi.com")response = Invoke-RestMethod -Uri ‘https://people-and-device-inventory.p.rapidapi.com/api/apigatewaydataservices/v1/devices’ -Method GET -Headers $headers
get all result pages
all=@()all+=$response.value
while($response.’@odata.nextLink’ -ne $null) {
$response = Invoke-RestMethod $response.’@odata.nextLink’ -Method Get -Headers $Headers
$all += $response.value
}
$all | ConvertTo-Json -Depth 100 | Out-File “c:\temp\devices.json”
Does this sound right ?