Setting up a discord Interaction Endpoint

How can I validate incoming interaction from Discord using make.com

I want to use make.com to automate my discord bot and I want to use the make.com webhook to send discord interactions to. According to their documentation, I must fulfill the following criteria with my scenario before Discord can save my webhook URL as an endpoint:

A Interactions Endpoint URL is a public endpoint for your app where Discord can send your app HTTP-based interactions. If your app is using Gateway-based interactions, you don’t need to configure an Interactions Endpoint URL.

Setting Up an Endpoint

Before you can add your Interactions Endpoint URL to your app, your endpoint must be prepared for two things ahead of time:

  1. Acknowledging PING requests from Discord
  2. Validate security-related request headers (X-Signature-Ed25519 and X-Signature-Timestamp)

If either of these are not complete, your Interactions Endpoint URL will not be validated. Details on acknowledging PING requests and validating security-related headers are in the sections below.

Acknowledging PING requests

When adding your Interactions Endpoint URL, Discord will send a POST request with a PING payload with a type: 1 to your endpoint. Your app is expected to acknowledge the request by returning a 200 response with a PONG payload (which has the same type: 1). Details about interaction responses are in the Receiving and Responding documentation.

Responding to PING Requests

Code example for acknowledging PING interactions

Validating Security Request Headers

The internet is a scary place, especially for people hosting public, unauthenticated endpoints. To receive interactions via HTTP, there are some security steps you must take before your app is eligible to receive requests.

Each interaction is sent with the following headers:

  • X-Signature-Ed25519 as a signature
  • X-Signature-Timestamp as a timestamp

Using your favorite security library, you must validate the request each time you receive an interaction. If the signature fails validation, your app should respond with a 401 error code.

Link to the documentation for reference: Discord Developer Portal

I just cannot get to seem it to work no matter what I try. Does anyone have any idea what the best approach is to handle this?

Kind regards,