【问题标题】:Xero API Reports endpoints unauthorisedXero API 报告未经授权的端点
【发布时间】:2020-01-13 10:18:32
【问题描述】:

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

收到此错误:

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

文档说这是一个用户角色问题,并建议“查看报告”访问权限已关闭,但我很确定这一切设置正确: screenshot of user role options

通过 API 预览器可以正常工作,所以我看不到我缺少什么。

有什么帮助吗?

如果有什么不同,我使用的是 Oauth2.0 路由。

【问题讨论】:

    标签: rest xero-api


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-19
      • 2019-02-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多