duanraotun1674 2016-07-26 23:49 采纳率: 100%
浏览 78

Bigcommerce Webhook

I am trying to implement the Bigcommerce webhook and I have successfullly cretead the store/product/updated* webhook. When I am trying to get the response on my destination url, I am getting nothing. I am using following code to record the response which is send by webhook to my url. My code is

<?php 
$webhook_content = '';
$webhook = fopen('php://input' , 'rb');
while(!feof($webhook)){ //loop through the input stream while the end of file is not reached
    $webhook_content .= fread($webhook, 4096); //append the content on the current iteration
}
fclose($webhook); //close the resource
$data=$webhook_content;
$data = json_decode($webhook_content,true); //convert the json to array
$myfile = __DIR__.'/productupdatelog.txt';
file_put_contents($myfile, print_r($data,true));
?>

But still I am not getting anything. Bigcommerce team is saying that Checking out that destination URL we do appear to be sending you webhooks and properly receiving back a 200 response from your server. But I am not able too record anything.

  • 写回答

2条回答 默认 最新

  • doudiyu1639 2016-07-28 20:53
    关注

    you can use file_get_contents and error_log to see the data:

    $webhookContent = file_get_contents("php://input");
    error_log($webhookContent);
    
    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大