Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

132
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda