oauth_signature 使用带有 GET 过滤器的 Magento Rest API 时出现无效错误

oauth_signature invalid error while using Magento Rest API with GET filters

当我使用像 http://localhost/magento/api/rest/orders/?filter[1][attribute]=entity_id&filter[1][gt]=70&page=1&limit=100

这样的 GET 过滤器时,我很难从 Magento REST API 获取订单

它给出了 "error":[{"code":401,"message":"oauth_problem=signature_invalid"}]

当我尝试使用像 Postman 这样的 REST 客户端访问同一个 API 端点时,我得到了想要的结果 JSON。

我怀疑过滤器查询中的方括号可能导致生成 Oauth 签名时出现问题。所有没有 GET 过滤器的端点都工作正常。 我正在使用 Request 节点模块通过 oauth headers.

发出 GET 请求

是否有任何修复来避免签名无效错误?

这里是详细的答案... http://magentoforce.com/2014/08/magento-rest-api-multiple-in-get-filters/

因为我花了一点时间才弄清楚如何做到这一点,所以我想我会把我学到的东西传下去。我的目标是向具有特定订单状态的 Magento REST API 到 return 订单发出单个请求。在我看到最后一行之前,查看 GET 过滤器文档页面并没有真正帮助。这是我提出的有效请求:

http://magentohost.com/api/rest/orders?filter[1][attribute]=status&filter[1][in][1]=pending&filter[1][in][2]=processing 上述请求将为您提供状态为“待定”或“处理中”的所有订单的列表。

参考:http://magentoforce.com/2014/08/magento-rest-api-multiple-in-get-filters/

问题出在我用来生成 OAuth signature.It 的请求节点模块中,没有考虑 URL 中的方括号。我修改了模块中的代码以包含方括号。更改 OAuth 签名生成方法为我修复了它