Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

131
Views
Receiving empty string on webhook request PHP

I am trying to pull customers info from webhook but I am receiving empty string when I try to print it. Here is my endpoint URL: image of webhook

Here is my PHP code:

<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
$data = file_get_contents('php://input');
$acion=json_decode($data,true);

var_dump($acion);
exit();
?>

I am getting NULL printed on my webpage. Any help is greatly appreciated.

about 4 years ago · Santiago Gelvez
2 answers
Answer question

0

There is no error in your code. The reason you getting NULL may be the data you are receiving is not in JSON format. You can check that by printing $data variable without decoding it with json_decode()

<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
$data = file_get_contents('php://input');

echo $data;
exit();
?>

And the second reason could be you are receiving data with a GET request. Then you can access data with $_GET[].

about 4 years ago · Santiago Gelvez Report

0

Your script is expecting a valid JSON-encoded request body, so you should test it accordingly. You cannot simply access the URL in your web browser, because there is no request body sent that way. Instead you need to use some tool which is capable sending such requests, e.g. Postman:

enter image description here

As you can see in the above screenshot, given the correct input, the output is also correct.

about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!