Troubleshooting - Jamf-Concepts/apiutil GitHub Wiki

Troubleshooting the API Utility

Keychain items

When you use the GUI portion of the app to save API target configurations, the information you enter is saved to your user keychain. If something goes wrong, you can delete the records and start over.

You can locate the entries by searching for "jsk" in Keychain Access. The environments item contains a list of your configured targets. Passwords for each target are stored in separate keychain item.

 

Application Preferences

The app stores some working data related to new version update notifications in ~/Library/Containers/org.jamfie.jamfapi

 

Accessing the Application Logs

The API Utility's logs will provide details about the actions you perform and can assist in troubleshooting API call failures.

To view additional logging, before using the app, open Terminal and run a log stream command. You may omit the --style parameter if you want to include details like timestamp and log level on the log entries.

Some prefer the logs created by adding --style compact to the log command. It still outputs the information you'll need.

log stream --info --predicate 'subsystem == "org.jamfie.jamfapi"' --style compact

In another Terminal tab or window, run an API command, for example:

jamfapi --target "<your target>" --path "/api/v1/buildings"

The log stream should yield output similar to the following.

jamfapi: [org.jamfie.jamfapi:runSilently] Running silently with arguments: --env Prod-api --path api/v1/buildings
jamfapi: [org.jamfie.jamfapi:runSilently] fetching password...
jamfapi: [org.jamfie.jamfapi:teamId] Resolving team ID...
jamfapi: [org.jamfie.jamfapi:teamId] found team ID: 483DWKW443
jamfapi: [org.jamfie.jamfapi:teamId] access group: 483DWKW443.jamfie.SharedJSK
jamfapi: [org.jamfie.jamfapi:teamId] sharedPrefix: JSK
jamfapi: [org.jamfie.jamfapi:retrieveCredentials] fetch credentials for service: jamfapi-environments, account: environments
jamfapi: [org.jamfie.jamfapi:retrieveCredentials] useApiClient: false
jamfapi: [org.jamfie.jamfapi:retrieveCredentials] keychainItemName: JSK-jamfapi-environments
jamfapi: [org.jamfie.jamfapi:credentialsLookup] keychain item count: 1 for JSK-jamfapi-environments
jamfapi: [org.jamfie.jamfapi:retrieveCredentials] fetch credentials for service: https://<your>.jamfcloud.com, account: a000aa0a-aa0a-a000-aa0a-a000aa0a0a0a0
jamfapi: [org.jamfie.jamfapi:retrieveCredentials] useApiClient: true
jamfapi: [org.jamfie.jamfapi:retrieveCredentials] keychainItemName: JSK-apiClient-<your>.jamfcloud.com
jamfapi: [org.jamfie.jamfapi:credentialsLookup] keychain item count: 2 for JSK-apiClient-<your>.jamfcloud.com
jamfapi: [org.jamfie.jamfapi:retrieveCredentials] found password/secret for: a000aa0a-aa0a-a000-aa0a-a000aa0a0a0a0
jamfapi: [org.jamfie.jamfapi:credentials] Found credential for a000aa0a-aa0a-a000-aa0a-a000aa0a0a0a0
jamfapi: [org.jamfie.jamfapi:tokenDelegate_getToken] get token - credentials
jamfapi: [org.jamfie.jamfapi:tokenDelegate_getToken]           type: Jamf Pro
jamfapi: [org.jamfie.jamfapi:tokenDelegate_getToken]   useApiClient: true
jamfapi: [org.jamfie.jamfapi:tokenDelegate_getToken]       username: a000aa0a-aa0a-a000-aa0a-a000aa0a0a0a0
jamfapi: [org.jamfie.jamfapi:tokenDelegate_getToken]  JamfProServer: https://<your>.jamfcloud.com
jamfapi: [org.jamfie.jamfapi:tokenDelegate_getToken] https://<your>.jamfcloud.com is using API client / secret for authentication
jamfapi: [org.jamfie.jamfapi:tokenDelegate_getToken] Attempting to retrieve token from https://<your>.jamfcloud.com/api/oauth/token
jamfapi: [org.jamfie.jamfapi:tokenDelegate_getToken] new token created for https://<your>.jamfcloud.com
jamfapi: [org.jamfie.jamfapi:tokenDelegate_getToken] https://<your>.jamfcloud.com will be renewed: false
jamfapi: [org.jamfie.jamfapi:tokenDelegate_getVersion] Token retrieved from https://<your>.jamfcloud.com/uapi/v1/jamf-pro-version
jamfapi: [org.jamfie.jamfapi:tokenDelegate_getToken] https://<your>.jamfcloud.com Jamf Pro Version: 11.14.1-t1740408745756
jamfapi: [org.jamfie.jamfapi:tokenDelegate_getVersion] https://<your>.jamfcloud.com set to use Bearer
jamfapi: [org.jamfie.jamfapi:runSilently] Jamf Pro GET api/v1/buildings
jamfapi: [org.jamfie.jamfapi:jpapiService_getPage] api/v1/buildings found on page 0: 7
⚠️ **GitHub.com Fallback** ⚠️