Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Curl 有效的BigCommerce身份验证令牌触发器';授权错误';有网络钩子吗?_Curl_Oauth_Bigcommerce_Webhooks - Fatal编程技术网

Curl 有效的BigCommerce身份验证令牌触发器';授权错误';有网络钩子吗?

Curl 有效的BigCommerce身份验证令牌触发器';授权错误';有网络钩子吗?,curl,oauth,bigcommerce,webhooks,Curl,Oauth,Bigcommerce,Webhooks,我已经通过了两步oAuth过程来获得一个长寿命的访问令牌。我可以通过使用cURL成功地进行几个API调用来验证访问令牌是否有效 curl -XGET -H 'X-Auth-Client: xxxxxxxxxxxxxxxxxxx' -H 'X-Auth-Token: xxxxxxxxxxxxxxxxxxx' https://api.bigcommerce.com/stores/xxxxx/v2/products …按预期返回商店产品。设置webhooks会按预期返回结果。然而:

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

curl -XGET 
  -H 'X-Auth-Client: xxxxxxxxxxxxxxxxxxx'
  -H 'X-Auth-Token: xxxxxxxxxxxxxxxxxxx'   
https://api.bigcommerce.com/stores/xxxxx/v2/products
…按预期返回商店产品。设置webhooks会按预期返回结果。然而:

产生
{“错误”:“授权错误”。}

代币是给店主的。商店所有者在管理界面中启用了所有可见的权限,并且如上所述,拥有配置新Webhook的能力


是否有单独的权限来启用列出Webhook?BigCommerceAPI只是有缺陷吗

授权错误。是一条误导性错误消息。问题实际上只是我需要在curl请求上显式设置accept头:

curl -XGET 
  -H 'X-Auth-Client: xxxxxxxxxxxxxxxxxxx'
  -H 'X-Auth-Token: xxxxxxxxxxxxxxxxxxx'   
  -H 'Accept: application/json'
https://api.bigcommerce.com/stores/xxxxx/v2/hooks
产生预期的结果

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