Error in API documentation for "List All Devices"

  • 20 May 2022
  • 0 replies
  • 142 views

Userlevel 2
Badge

I think I have found an error in the PowerShell request sample from the documentation for Automox’s "List All Devices" API call.  The request sample has:

$url = "https://console.automox.com/api/servers?o=:orgID&page=0&limit=500"

This did not run until I changed :orgID to $orgID in order to reference my Organization ID.

Actually, I now see that the sample does not include a definition of $orgID either.  So, altogether IMO the sample should read,

$apiKey = 'your_automox_api_key'

$orgID = ‘your organization ID’

$headers = @{ "Authorization" = "Bearer $apiKey" }

$url = "https://console.automox.com/api/servers?o=$orgID&page=0&limit=500"

$response = (Invoke-WebRequest -Method Get -Uri $url -Headers $headers).Content

I raise this issue because the PowerShell error resulting from the sample isn’t very specific.  Due to that, and because I am only beginning to use this API, it took me quite awhile to discover that the sample was incorrect as opposed to my having made a mistake.  Therefore, please fix this, and thanks!

 


0 replies

Be the first to reply!

Reply