json - 查询 Visma Net 帐户表时出现 IPPException

标签 json postman

当我使用 Postman 发出请求以查询 Visma Net API/account 端点时,我收到 HTTP 400 Bad Request 错误:

{
  "ExceptionType": "IPPException",
  "ExceptionMessage": "",
  "ExceptionFaultCode": "12002",
  "ExceptionMessageID": "12002_12002_some-guid",
  "ExceptionDetails": ""
}

我发送的请求是:

https://integration.visma.net/API/controller/api/v1/account?active=true

我将从 OAuth 身份验证步骤接收到的 Bearer token 放在 Authorization header 中。

最佳答案

至少在以下情况下,Visma.net 会返回 12002 代码:

  • 未设置公司 ID(在 Swagger 站点中:在右上角输入 ID,使用 Context in list 检索可供您使用的公司列表)。
  • 用户未根据 HTTP header 中提供的公司 ID 进行身份验证。

使用招摇:https://integration.visma.net/API-index/ .

visma.net API swagger站点右上角的ipp-company-id也可以手动处理。

除了 Authorization header ,您还设置了两个 header :

  • ipp-company-id: 公司id
  • ipp-application-type:始终为“Visma.net Financials”

最好是与 Visma 签订合作伙伴协议(protocol)。他们有很多附加信息和培训视频。请注意,不支持隐式授权,仅支持代码授权流程,因此在不受信任的设备上运行时会涉及一些安全风险。最好是为每个不受信任的环境获取一个客户端 ID,或者仅从您自己的受信任环境中使用 visma.net API。

关于json - 查询 Visma Net 帐户表时出现 IPPException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53636772/

相关文章:

python - 导航中的变量传递到 Jinja 2 中的基础和所有模板

javascript - IHttpActionResult 不会返回 JSON 对象

c# - 在 VS 2012 中将 C# 类粘贴为 JSON

amazon-web-services - 签名已过期 : is now earlier than error : InvalidSignatureException

node.js - postman :无法发送请求

spring-security - 使用Postman测试 Spring 安全性

javascript - VueJS2 排序 JSON