Xero API 报告端点未经授权

Xero API Reports endpoints unauthorised

我正在尝试通过 Postman 对以下端点进行一些 GET 调用: https://api.xero.com/api.xro/2.0/Reports/BalanceSheet

出现此错误:

{"title":"Unauthorized","status":401,"detail":"AuthorizationUnsuccessful","instance":"674c99d2-0ae3-4940-b23b-aec74cef79ea"}

文档说这是一个用户角色问题,并建议 "view reports" 访问已关闭,但我很确定这一切都已正确设置: screenshot of user role options

它在 API 预览器中工作正常,所以我看不到我遗漏了什么。

有什么帮助吗?

如果有区别,我使用的是 Oauth2.0 路由。

您可能会错过 accounting.reports.read 范围。

在授权过程中,当您将用户定向到 https://login.xero.com/identity/connect/authorize... url 时,请尝试在 scope 查询参数中包含 accounting.reports.read(连同您现有的范围,当然)。