People and Device Inventory

PAID
Neurons
By Ivanti | Updated 7 months ago | Discover
Back to All Discussions

number of devices returned

Rapid account: Andrede Meijer
AndredeMeijer
a year ago

Hi When I use the Get Devices, I only get 10 devices althoug my tenant has 888 devices, how can I retrieve all devices ?

Rapid account: Benoitpourville
benoitpourville commented 14 days ago

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.

Rapid account: Stevencarman
stevencarman commented a year ago

Did you ever get this working? Have you ran into issues with the bearer token expiring?

Rapid account: Andrede Meijer
AndredeMeijer commented a year ago

I believe I found the solution:

Neurons devices

Get API token

headers=@headers=@{} headers.Add(“X-TenantId”, “XXXX”)
headers.Add("XClientSecret","XXXX")headers.Add("X-ClientSecret", "XXXX") headers.Add(“X-ClientId”, “XXXXX”)
headers.Add("XRapidAPIKey","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

Connection details to rapidApi

headers=@headers=@{} headers.Add(“Authorization”, "Bearer key")key") headers.Add(“X-RapidAPI-Key”, “XXXXXXX”)
headers.Add("XRapidAPIHost","peopleanddeviceinventory.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

get all result pages

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:

Login / Signup to post new comments