Below is an example of how to use the new REST API in Applications Manager 9.6.0 and above using curl commands in powershell
Resolution
Please note the following is just an example. A knowledge of powershell and the REST API are necessary to implement this. Errors from powershell need to be reviewed by OS admins.
Start by encoding the username and password in a string: username:password For example, with the username admin and password admin, you could run:
You can then retrieve the Authorization token by consuming the POST method for the /auth endpoint and set it to the $bearer_token variable:
$bearer_token = curl -X POST "http://[RESTI API servername or IP]:[REST API port]/auth" -H "Authorization: Basic $encodedString" -H "Content-Type: application/json"
This can then be used for additional REST API endpoint consumption. For example, you can use the following to get an agent list:
curl "http://[RESTI API servername or IP]:[REST API port]/api/agents" -H "Authorization: Bearer $bearer_token"
This will bring back the result with all agents as you would see them in the UI.