Skip to main content
Solved

Device discovery by org in api call

  • July 25, 2024
  • 2 replies
  • 0 views

  • New Contributor

Looking for a way to filter on devices by a particular org  

 

Tried using the following method 

SL1stacksite.net/api/device?limit=10&searchspec?organization=xx

 

Best answer by jamesramsden

/api/device?limit=100&organization=XX

 

 

Python example:

import requests

 

url = "https://XYZ/api/device?limit=100&organization=XX"

 

payload = {}

headers = {

  'Pragma': 'no-cache',

  'Accept': 'application/json',

  'Cache-Control': 'no-cache',

  'Authorization': 'Basic XYZ'

}

 

response = requests.request("GET", url, headers=headers, data=payload)

 

print(response.text)

2 replies

Forum|alt.badge.img
  • Contributor II
  • Answer
  • July 26, 2024

/api/device?limit=100&organization=XX

 

 

Python example:

import requests

 

url = "https://XYZ/api/device?limit=100&organization=XX"

 

payload = {}

headers = {

  'Pragma': 'no-cache',

  'Accept': 'application/json',

  'Cache-Control': 'no-cache',

  'Authorization': 'Basic XYZ'

}

 

response = requests.request("GET", url, headers=headers, data=payload)

 

print(response.text)


SaraLeslieAdmin
Forum|alt.badge.img

Hello @SK9 can you let us know if @jamesramsden 's solution helped solve your question? If so, please take a minute to mark his response as the solution. Thank you, Sara