To complete Jamf Protect API requests, each GraphQL query must include an authorization header with an access token.
To obtain an access token to include in an authorization header for Jamf Protect API requests, you can execute the following command using information from your API client configuration:
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>"}'The access token can then be included in API requests similar to the following curl command:
curl -H "Content-Type: application/json" \
-H "Authorization: YOUR-ACCESS-TOKEN" \
-X POST "https://your-tenant.protect.jamfcloud.com/graphql" \
-d '{"query": "query {listComputers {items {hostName, uuid, checkin}}}"}'