Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

135
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda