php - How can I print incoming webhook data in real-time on my browser?
I have set Webhook notification on Shopify platform when a new order is placed. I send the data to the URL of a PHP app I am currently working on and I want to print the incoming data in real-time on my browser. It is the first time I am working with Webhooks so any advice will be helpful. Thank you!
if you still need help with this: on the file you have set your webhook on use the following code to catch any incoming posts, you can print them or trigger them into your terminal.
$json = file_get_contents('php://input'); $data = json_decode($json,1);
i hope this helps you! Good day!
Consider using Request Bin (https://requestbin.co/), Webhook Site (https://webhook.site/#/) or Ngrok (https://ngrok.com/)
All these tools allow you to generate a unique end point and see webhooks recieved in real time. However there are several benefits of using Ngrok opposed to online tools. It runs locally and allows you to forward data to your local application. So Ngrok will allow you to see webhooks data on local web page and you can also send the same data to your local PHP application simultaneously.
Ngrok Documentation (https://ngrok.com/docs)
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.