How to Access API Swagger documentation page?
https://developer.arubanetworks.com/aruba-central/docs/api-swagger-documentation


HPE GreenLake > Choose your Workspace > Aruba Central

in Aruba Central
- Global > Maintain > Organization > Platform Integration > API Gateway
>> hier you see:
>>> All Published APIs(1): https://apigw-eucentral3.central.arubanetworks.com/swagger/apps/nms/
>>> My Apps & Token / System Apps & Tokens: here you can create tokens to access the api

A token looks like:
Name: token-2024-01-26
Client ID: 5ojXi9VA2M....
Client Secret: weADaFKs....
Redirect URI: https://arubanetworks.com

{"access_token":"naMvrERSNB....",
"appname":"nms",
"authenticated_userid":"...."
,"created_at":1706258335937,
"credential_id":"afb0cc34-ceef-....",
"expires_in":7200,
"id":"164017b7-04dc-49a5-.....3",
"refresh_token":"mPYTOxctckc2J.......TihBVIeKiv",
"scope":"all",
"token_type":"bearer"}

After you created a token let's go to the API page:
https://apigw-eucentral3.central.arubanetworks.com/swagger/apps/nms/


example 1: get list of all access points

Request URL:
https://apigw-eucentral3.central.arubanetworks.com/monitoring/v2/aps


#########################################################
python mini script sample
#########################################################
#!/usr/bin/python3
import requests

# Aruba Central API details
#access_token: don't use the token id with dashes like "02828cde-2f1f-.....",
#use the access_token (click on download on webpage!)
access_token = "EHhi6Y18W....."
api_endpoint = "https://apigw-eucentral3.central.arubanetworks.com/monitoring/v2/aps"


# Make request to Aruba Central API for access points
headers = {"Authorization": f"Bearer {access_token}"}
api_response = requests.get(api_endpoint, headers=headers)
api_response.raise_for_status()

# Parse and print the response
access_points_data = api_response.json()
print("Aruba Central Access Points Information:")
print(access_points_data)

############################################################

computer2know :: thank you for your visit :: have a nice day :: © 2024