Hi Martin,
If you want, check this ClearPass API Guide https://www.slideshare.net/ArubaNetworks/emea-airheads-getting-started-with-the-clearpass-rest-api-cppm or if you prefer a video format check this session to better understand ClearPass APIs https://www.brighttalk.com/webcast/16725/339965/airheads-tech-talks-getting-started-with-the-clearpass-rest-api-cppm
In brief, you need to
1) Create an API CLIENT and get a client_id and client_secret. You assign it an operator profile role that has API access. You control what is allowed for this profile depending on your requirements. For your requirements, you need at least read access to the platform – servers
2) You then get an access token by accessing https://YOUR_CLEARPASS:443/api/oauth and passing in the needed parameters (Grant Type, Client_ID, CLIENT_SECRET..etc depending on the grant_type you decide to use). For example, for grant_type client_credentials, you can use
{
"grant_type": "client_credentials",
"client_id": "<YOUR_CLIENT_ID>",
"client_secret": "<YOUR_CLIENT_SECRET>"
}
You should get Response Code 200 and get an access token
3) You use this access token to pass it any API call and part of HTTP headers. For example, calling https://<YOUR_CLEARPASS>:443/api/cluster/server
Authorization: Bearer <access_token>
The data that you need is shown below. This can be easily extracted since it is in JSON format.
Once you have this working from ClearPass, you can then write a code for the same...
Hope you find this useful..