有效的BigCommerce认证令牌触发器的授权错误获取webhooks? [英] Valid BigCommerce auth token triggers 'Authorization Error' getting webhooks?

查看:287
本文介绍了有效的BigCommerce认证令牌触发器的授权错误获取webhooks?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经完成了两步骤的oAuth过程,以获得长期访问令牌。我可以通过使用cURL成功进行几个API调用来验证访问令牌是否有效...

I've gone through the two step oAuth process to get a long lived access token. I can validate that the access token is valid by successfully making several API calls with cURL...

curl -XGET 
  -H 'X-Auth-Client: xxxxxxxxxxxxxxxxxxx'
  -H 'X-Auth-Token: xxxxxxxxxxxxxxxxxxx'   
https://api.bigcommerce.com/stores/xxxxx/v2/products

...按预期返回商店产品。置备webhooks按预期返回结果。但是请求网络访问列表

...returns the store products as expected. Provisioning webhooks returns results as expected. However requesting the list of webhooks:

curl -XGET 
  -H 'X-Auth-Client: xxxxxxxxxxxxxxxxxxx'
  -H 'X-Auth-Token: xxxxxxxxxxxxxxxxxxx'   
https://api.bigcommerce.com/stores/xxxxx/v2/hooks

产生 {error:授权错误。}

商店所有者在管理界面中启用所有可见权限,如上所述,您可以配置新的网络挂钩。

The token is for the store owner. The store owner has all visible permissions enabled in the admin interface, and as stated above has the ability to provision new webhooks.

在某处有单独的权限, ? BigCommerce API只是有bug吗?

Is there a separate permissions somewhere to enable listing webhooks? Is the BigCommerce API just buggy?

推荐答案

授权错误是一个误导性的错误讯息。问题实际上只是我需要明确设置接受头部curl请求:

The Authorization Error. is a misleading error message. The problem is actually just that I needed to explicitly set the accept header on the curl request:

curl -XGET 
  -H 'X-Auth-Client: xxxxxxxxxxxxxxxxxxx'
  -H 'X-Auth-Token: xxxxxxxxxxxxxxxxxxx'   
  -H 'Accept: application/json'
https://api.bigcommerce.com/stores/xxxxx/v2/hooks

产生预期结果。

这篇关于有效的BigCommerce认证令牌触发器的授权错误获取webhooks?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆