交換授權碼、重新整理工作階段,或驗證機密用戶端
POST
/v1/oauth/token
const url = 'https://api.vimine.network/v1/oauth/token';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"grant_type":"authorization_code","client_id":"example","client_secret":"example","code":"example","code_verifier":"example","redirect_uri":"https://example.com","refresh_token":"example","scope":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.vimine.network/v1/oauth/token \ --header 'Content-Type: application/json' \ --data '{ "grant_type": "authorization_code", "client_id": "example", "client_secret": "example", "code": "example", "code_verifier": "example", "redirect_uri": "https://example.com", "refresh_token": "example", "scope": "example" }'OAuth 2.1 權杖端點。grant_type=authorization_code(+ PKCE S256,來自「使用 Vimine 登入」)、refresh_token(輪換;重複使用會撤銷整個工作階段系列)、client_credentials(機密用戶端,透過 HTTP Basic 或請求本文驗證)。錯誤遵循 RFC 6749。
請求本文必填
章節「請求本文必填」媒體類型application/json
object
grant_type
必填
string
client_id
string
client_secret
string
code
string
code_verifier
string
redirect_uri
string 格式: uri
refresh_token
string
scope
string
回應
章節「回應」200
章節「200」權杖回應
媒體類型application/json
object
access_token
string
token_type
string
expires_in
integer
refresh_token
string
scope
string
sub
string
範例自動產生
{ "access_token": "example", "token_type": "example", "expires_in": 1, "refresh_token": "example", "scope": "example", "sub": "example"}400
章節「400」請求無效
媒體類型application/problem+json
object
type
必填
string 格式: uri
title
必填
string
status
必填
integer
detail
string
code
必填
string
request_id
string
errors
Array<object>
object
field
string
code
string
message
string
範例自動產生
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "code": "example", "request_id": "example", "errors": [ { "field": "example", "code": "example", "message": "example" } ]}404
章節「404」找不到
媒體類型application/problem+json
object
type
必填
string 格式: uri
title
必填
string
status
必填
integer
detail
string
code
必填
string
request_id
string
errors
Array<object>
object
field
string
code
string
message
string
範例自動產生
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "code": "example", "request_id": "example", "errors": [ { "field": "example", "code": "example", "message": "example" } ]}429
章節「429」超出速率限制
媒體類型application/problem+json
object
type
必填
string 格式: uri
title
必填
string
status
必填
integer
detail
string
code
必填
string
request_id
string
errors
Array<object>
object
field
string
code
string
message
string
範例自動產生
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "code": "example", "request_id": "example", "errors": [ { "field": "example", "code": "example", "message": "example" } ]}500
章節「500」內部錯誤
媒體類型application/problem+json
object
type
必填
string 格式: uri
title
必填
string
status
必填
integer
detail
string
code
必填
string
request_id
string
errors
Array<object>
object
field
string
code
string
message
string
範例自動產生
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "code": "example", "request_id": "example", "errors": [ { "field": "example", "code": "example", "message": "example" } ]}