跳到內容

交換授權碼、重新整理工作階段,或驗證機密用戶端

POST
/v1/oauth/token
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
允許的值: authorization_code refresh_token client_credentials
client_id
string
client_secret
string
code
string
code_verifier
string
redirect_uri
string 格式: uri
refresh_token
string
scope
string

權杖回應

媒體類型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"
}

請求無效

媒體類型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"
}
]
}

找不到

媒體類型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"
}
]
}

超出速率限制

媒體類型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"
}
]
}

內部錯誤

媒體類型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"
}
]
}