主体自省:ownerType/scopes/user + 本人所在 orgs(id/name/role;org PAT 主体 role=null)
GET
/v1/auth/whoami
const url = 'https://api.tansr.com/v1/auth/whoami';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.tansr.com/v1/auth/whoami \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”主体信息
Media typeapplication/json
object
scopes
required
Array<string>
user
required
Example
{ "ownerType": "user", "orgs": [ { "role": "owner" } ]}本文是否有帮助?
感谢反馈,我们会持续改进这篇文章。