- Have a try with this one :
import requests
def get_wireless_client_summary(site_name, building_name, ssid_name):
api_url = "https://dnacenter.cisco.com/api/v1/network-device-group/device-groups/" + site_name + "/buildings/" + building_name + "/sites/0/clients"
headers = {
'Authorization': 'Bearer <your_token>',
'Content-Type': 'application/json'
}
params = {
'startDate': '2024-01-01',
'endDate': '2024-01-31',
'ssidName': ssid_name
}
response = requests.get(api_url, headers=headers, params=params)
if response.status_code == 200:
response_json = response.json()
print(response_json)
else:
print('Error: {}'.format(response.status_code))
if __name__ == '__main__':
# Replace with your site name, building name, and SSID name
site_name = 'Default-Site'
building_name = 'Building1'
ssid_name = 'Guest'
get_wireless_client_summary(site_name, building_name, ssid_name)
- Replace the placeholders for site_name, building_name, and ssid_name with the actual names of your site, building, and SSID. You will also need to replace the placeholder for <your_token> with your DNA Center API token. You can get your API token from the Cisco DNA Center web UI.
M.
-- Each morning when I wake up and look into the mirror I always say ' Why am I so brilliant ? '
When the mirror will then always repond to me with ' The only thing that exceeds your brilliance is your beauty! '