Forum Discussion

SK's avatar
SK
Icon for Participant rankParticipant
3 months ago

Device discovery by org in api call

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

 

  • /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)

  • Hello SK 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 

  • /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)