Search code examples
amazon-web-servicesrestaws-api-gatewayadyen

How to set up Amazon API gateway to receive Adyen webhooks


I'm trying to configure API Gateway in AWS to receive webhooks from the Adyen platform.

I used API gateway integration with an S3 bucket and created an API, using the following link

https://docs.aws.amazon.com/apigateway/latest/developerguide/integrating-api-with-aws-services-s3.html

The authentication is "none" in my configuration, however i'm observing error related to authorization. Since i'm new to APIs, I couldn't understand this.

The webhook is an HTTP post method

{
  "live": "false",
  "notificationItems": [
    {
      "NotificationRequestItem": {
        "amount": {
          "currency": "EUR",
          "value": 0
        },
        "eventCode": "REPORT_AVAILABLE",
        "eventDate": "2022-11-22T15:19:37+01:00",
        "merchantAccountCode": "COM",
        "merchantReference": "testMerchantRef1",
        "pspReference": "1OW4XY4YXEFDLM0F",
        "reason": "will contain the URL to the report",
        "success": "true"
      }
    }
  ]
}

The response I received is

{"message":"Authorization header requires 'Credential' parameter. Authorization header requires 'Signature' parameter. Authorization header requires 'SignedHeaders' parameter. Authorization header requires existence of either a 'X-Amz-Date' or a 'Date' header. Authorization=Basic amFnYTYxOTBAZ21haWwuY29tOndJTERGSVJFQDEyMw=="}

Amazon API Gateway Configuration

enter image description here


Solution

  • According to the official documentation the particular error you are receiving indicates that you are trying to invoke a non-existing resource. In particular, the root cause is

    A request with an "Authorization" header is sent to an API resource path that doesn't exist.

    Are you sure that you have published your API properly?