OAuth
簽發存取權杖
client_credentials、authorization_code、refresh_token 可換取 3600 秒有效的權杖。
請求本文
application/x-www-form-urlencoded, application/json
grant_typestring必填要交換的授權類型:
client_credentials、authorization_code或refresh_token允許的值:
client_credentialsauthorization_coderefresh_tokenclient_idstring必填用戶端應用的識別碼
client_secretstring機密用戶端的金鑰(
client_secret_post),或放在Authorization: Basic標頭中(client_secret_basic),不可同時使用;公開用戶端無需提供scopestring申請的 scope,以空格分隔;省略則為該授權的全部 scope
workspace_idstring權杖所操作的 Workspace:在
client_credentials下應用有多個時必填,只有一個時可選codestringauthorization_code:在重新導向位址收到的授權碼code_verifierstringauthorization_code:PKCE 驗證碼(RFC 7636)redirect_uristringauthorization_code:與授權時相同的重新導向位址refresh_tokenstringrefresh_token:更新權杖,僅可使用一次
回應
200application/json
存取權杖;只有授予了 offline_access 才會包含 refresh_token。
access_tokenstring必填不透明的存取權杖
token_typestring必填始終為
Bearer允許的值:
Bearerexpires_innumber必填有效期,單位為秒
scopestring必填已授予的 scope,以空格分隔
refresh_tokenstring僅限
authorization_code和refresh_token,且已授予offline_access:僅可使用一次,每次交換都會輪替
400
invalid_request、invalid_grant、unsupported_grant_type、invalid_scope 或 unauthorized_client。
401
invalid_client:未知用戶端、金鑰錯誤或缺失,或應用已被撤銷。