授權

Jamf Protect 說明文件

Solution
Application
Content Type
技術說明文件
Utilities & Services
ft:locale
zh-TW

要完成 Jamf Protect API 請求,每個 GraphQL 查詢都必須包含一個帶有存取 Token 的授權標頭。

要取得存取 Token 以包含在 Jamf Protect API 請求的授權標頭中,您可以使用 API 用戶端組態的資訊來執行下列命令:

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>"}'

然後可以將存取 Token 包含在 API 請求中,類似於下列 curl 命令:

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}}}"}'