# 接口授權
# PA-API-1.1 獲取 Access token
POST /oauth/token
接口類型 | 請求接口 |
說明 | 獲取 Access token,請參考接口授權的使用方式 |
# 請求參數
名稱 | 類型 | 必填 | 默認值 | 說明 | 備註 |
---|---|---|---|---|---|
client_id | string | Y | - | Zeek 團隊提供的 App ID | |
client_secret | string | Y | - | Zeek 團隊提供的 App secret | |
grant_type | string | N | "client_credentials" | OAuth Grant Type | 目前只支持"client_credentials" |
scope | string | N | "delivery" | OAuth scope | 目前只支持"delivery" |
例子:
{
"client_id": "xxxxxxx",
"client_secret": "xxxxxxxxxxxxxxxxxxx",
"grant_type": "client_credentials",
"scope": "delivery"
}
# 返回結果
名稱 | 類型 | 說明 | 備註 |
---|---|---|---|
token_type | string | Token 類型 | 開發者在調用接口時需要在 HTTP Authorization Header 傳入 (目前只返回 Bearer ) |
access_token | string | Access token | |
expires_in | int | Access token 的有效時長 | 單位:秒 |
scope | string | OAuth 的 scope | 目前只返回 "delivery" |
例子:
{
"error" : 0,
"data": {
"token_type": "Bearer",
"access_token": "xxxxxxxxxxxxxxxxxxxxxxx",
"expires_in": 86400,
"scope": "delivery"
}
}