Skip to content

Issues Routing GBG Webhook Requests through API Gateway to Lambda

0

Hi ,

We are encountering an issue where requests from an external service (GBG) are successfully reaching our Lambda function when bypassing API Gateway, but fail when routed through API Gateway. The API Gateway works perfectly when tested with tools like Postman and another service hosted on Cloud Run, but it fails to process the requests coming from GBG.

Here’s our current flow:

  1. GBG webhook sends a request to our API Gateway URL.
  2. The API Gateway forwards the request to our Lambda function.
  3. The Lambda function processes the request.

It is important to note that there is no authentication set up on the API Gateway, so it should allow all incoming requests.

The issue seems to be specific to requests coming from GBG, as we’ve extensively tested API Gateway with other services, and everything functions correctly. Unfortunately, the GBG webhook is a black box to us, and we don't have access to its logs.

Example curl request:

This is a sample of the kind of request we are testing:

curl --location 'https://your-api-id.execute-api.region.amazonaws.com/gbg/OnJourneyFinished' \
--header 'Content-Type: application/json' \
--data '{
    "JourneyId": "sample-journey-id"
}'

Can you please suggest what might be happening with the API Gateway layer? We couldn't find any issues, and we are intercepting requests in API Gateway metrics as well. Additionally, in CloudWatch, it appears that requests are not reaching API Gateway in the case of GBG.

Any guidance or assistance would be greatly appreciated.

2 Answers
0

Hi,

AWS API Gateway is also integrated with AWS CloudTrail, which can record all calls to the API of the Gateway: https://docs.aws.amazon.com/apigateway/latest/developerguide/cloudtrail.html

I would start by trying to activate this for your gateway to see if your get the calls of you GDG calls recorded or not by CloudTrail. If yes, you'll also get the returned http status to get a better idea of the problem.

Best,

Didier

EXPERT
answered a year ago
0

Hi Didier,

Thanks for the suggestion. We enabled CloudTrail for the API Gateway, but we found that CloudTrail only logs management events and does not capture public requests like those coming from GBG. This means we couldn't use it to trace those specific webhook calls. Additionally, we have CloudWatch attached to the API Gateway to collect logs for every call, and while it works perfectly for requests from Postman and other services like Cloud Run, it still does not log anything when GBG sends requests through the API Gateway. It seems the GBG webhook requests aren’t reaching the Gateway at all, despite no authentication or other restrictions being set up.

Any further guidance would be appreciated!

Best,
Hemant

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.