V
V
Vladimir Kashchev2019-03-05 18:55:51
PHP
Vladimir Kashchev, 2019-03-05 18:55:51

How to process a webhook request in php - json?

I need to receive data from the service,
there the data is sent to the webhook in json format.
I do this, but nothing comes to me, the service says that everything works for them and my script gives a 500 error.
Although if you just open the script in the browser, everything is fine, it gives a 200 error and sends an empty letter to me.
$requestBody = file_get_contents('php://input');
mail($mail 'api', $requestBody);
where is the mistake?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2019-03-05
@AndreevSergP

Look at access log for a start. Then I'll try to just write their requests to the file. Most likely an error in sending the email.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question