创建 API 客户机

这些资源的配置是通过使用 ISV REST API 完成的。 要调用这些 API,您必须获取访问令牌。

如果尚未创建 API 客户机,请创建该客户机。 请参阅 “创建 API 客户端 ”。 使用其客户机凭证来获取访问令牌以与以下 CURL 命令配合使用。

以下权利是 API 客户机所必需的。
  • managemfamethods
  • manageaccesspolicies

OAuth 客户机凭证请求的示例

使用此示例来获取访问令牌。
curl --location --request POST 'https://{{tenant}}/v1.0/endpoint/default/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Accept: application/json' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id={{client id}}}}' \
--data-urlencode 'client_secret={{client secret}}'

Response:

{
    "access_token": "4RKLXZUMymwu9izVsDcll9SY",
    "grant_id": "4331b551-0a23-4a8e-8ee1-3db2a2e84efe",
    "token_type": "Bearer",
    "expires_in": 7200
}