discord / discord-example-app

Basic Discord app with examples
MIT License
515 stars 525 forks source link

Interactions endpoint URL with ngrok #16

Closed slingercode closed 1 year ago

slingercode commented 1 year ago

Similar issue closed without a solution.

Trying to add a URL from ngrok on the interactions endpoint URL of the app configuration, there is an error that refuses to save the data even when the connection is successful.

Screen Shot 2022-11-20 at 18 04 43
{
    "code": 50035,
    "errors": {
        "interactions_endpoint_url": {
            "_errors": [
                {
                    "code": "APPLICATION_INTERACTIONS_ENDPOINT_URL_INVALID",
                    "message": "The specified interactions endpoint URL could not be verified."
                }
            ]
        }
    },
    "message": "Invalid Form Body"
}
slingercode commented 1 year ago

Solved.

The reason of the error is because the API does not solve a PING event. After updating the code with this validation works fine

Here is the section of the docs that explains this.