门户激活页确认/拒绝设备码(登录会话;决策恒审计 auth.device_approved/denied,先审计后落态)
POST
/v1/auth/device/approve
const url = 'https://api.tansr.com/v1/auth/device/approve';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"userCode":"example","approve":true}'};
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.tansr.com/v1/auth/device/approve \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "userCode": "example", "approve": true }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
userCode
required
string
approve
required
boolean
Examplegenerated
{ "userCode": "example", "approve": true}Responses
Section titled “Responses”已登记
Not_found
Media typeapplication/json
object
error
required
object
code
required
错误码注册表单源派生(src/http/errors.ts ERROR_CODES;码稳定,消费方按码翻译)
string
message
required
string
requestId
required
string
detail
object
Example
{ "error": { "code": "adjudicator_not_authorized" }}本文是否有帮助?
感谢反馈,我们会持续改进这篇文章。