Examples Protect - Jamf-Concepts/apiutil GitHub Wiki
Jamf Protect API Documentation
If you wanted to obtain an API login token by traditional means, you could use a command like this:
ACCESS_TOKEN=$(curl \
--request POST \
--header 'content-type: application/json' \
--url "https://your-tenant.protect.jamfcloud.com/token" \
--data '{"client_id": "<CLIENT-ID>", "password": "<API-CLIENT-PASSWORD>"})'
But once you've configured your API information in the API Utility app, you can obtain a token by simply saying:
ACCESS_TOKEN=$(jamfapi --target "your-protect-target-name")
Then you can use the token to authenticate API calls...
curl \
-H "Content-Type: application/json" \
-H "Authorization: ${ACCESS_TOKEN}" \
-X POST "https://<your-tenant>.protect.jamfcloud.com/graphql" \
-d '{"query": "query {listComputers {items {hostName, uuid, checkin}}}"}'
Auth token retrieval is the only option supported by the API Utility when connecting to the macOS Endpoint Protection API.