Contentful logo

Contentful Community

Webhook returning unknown error

Hi!

i added a webhook to my website when any entry are published or unpublished.

My endpoint is correctly called, but in contentful i get:

2018-07-13T15:09:50.225Z Unknown error View details

In my code, i made a simple response for testing…

public function webhook($request, $response, $args)
{
    return $response->withStatus(200)->withJson(true);
}

Thanks

Hi @olivier.castro-perri,

To further investigate this issue, we’d need you to send us some more details in our support channel.

The problem of not receiving web-hook calls might be on the receiving application’s side. To make sure this isn’t the case, you can compare a test call to the one you’re receiving in your application.

To do this, please first create a Request Bin. Then, go to the settings page on your Contentful web interface. Configure Request Bin as an additional web-hook endpoint. Now you should be able to perform the test request and compare the response with that of your application. After this, you should be able to tell whether the problem is on your side. If that’s the case, go to the Contentful interface, and open an entry or asset that has the web-hook problem. Copy the URL for that entry/asset, and send it to us.

The last thing we’ll need is permission to access your content, to check where exactly the problem is.

In fact, i tried with a webhook tester and i got the response status 200… So i think the problem is on my side.

When my endpoint is reached, the code is executed, but the response returned is null in Contentful webhook interface…

Okay i found what was the problem.

I was testing my webhook in a staging environment!

The thing is that the security certificat is not valid and that is why the responses is null for some reasons…

That indeed can cause this problem and I’m glad to hear you find it :slight_smile:
Let us know if you have any other questions.

1 Like