diff --git a/docs/Reference.mdx b/docs/Reference.mdx index 44187d361b..f3985c569a 100644 --- a/docs/Reference.mdx +++ b/docs/Reference.mdx @@ -235,6 +235,10 @@ Clients may append more information and metadata to the _end_ of this string as > warn > Client requests that do not have a valid User Agent specified may be blocked and return a [Cloudflare error](https://support.cloudflare.com/hc/en-us/articles/360029779472-Troubleshooting-Cloudflare-1XXX-errors). +### Content Type + +Clients using the HTTP API must provide a valid `Content-Type` header, either `application/json`, `application/x-www-form-urlencoded`, or `multipart/form-data`, except where specified. Failing to do so will result in a `50035` "Invalid form body" error. + ### Rate Limiting The HTTP API implements a process for limiting and preventing excessive requests in accordance with [RFC 6585](https://tools.ietf.org/html/rfc6585#section-4). API users that regularly hit and ignore rate limits will have their API keys revoked, and be blocked from the platform. For more information on rate limiting of requests, please see the [Rate Limits](#DOCS_TOPICS_RATE_LIMITS/rate-limits) section. diff --git a/docs/events/Webhook_Events.mdx b/docs/events/Webhook_Events.mdx index 5a65f25059..24a3c6ad14 100644 --- a/docs/events/Webhook_Events.mdx +++ b/docs/events/Webhook_Events.mdx @@ -45,6 +45,9 @@ If either of these are not complete, your Webhook Events URL will not be validat When adding your Webhook Events URL, Discord will send a `POST` request with a `PING` payload with a `type: 0` to your endpoint. Your app is expected to acknowledge the request by returning a `204` response with an empty body. +> info +> You must provide a valid `Content-Type` when responding to `PING`s. See [here](#DOCS_REFERENCE/http-api) for further information. + To properly acknowledge a `PING` payload, return a `204` response with no body: diff --git a/docs/interactions/Overview.mdx b/docs/interactions/Overview.mdx index 2894df0d6e..0458640f88 100644 --- a/docs/interactions/Overview.mdx +++ b/docs/interactions/Overview.mdx @@ -80,6 +80,9 @@ If either of these are not complete, your Interactions Endpoint URL will not be 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](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING). +> info +> You must provide a valid `Content-Type` when responding to `PING`s. See [here](#DOCS_REFERENCE/http-api) for further information. + To properly acknowledge a `PING` payload, return a `200` response with a payload of `type: 1`: diff --git a/docs/interactions/Receiving_and_Responding.mdx b/docs/interactions/Receiving_and_Responding.mdx index 9c189c76b5..f2386e363f 100644 --- a/docs/interactions/Receiving_and_Responding.mdx +++ b/docs/interactions/Receiving_and_Responding.mdx @@ -200,6 +200,9 @@ Now that you've gotten the data from the user, it's time to respond to them. Interactions--both receiving and responding--are webhooks under the hood. So responding to an Interaction is just like sending a webhook request! +> info +> Interaction responses have the same header requirements as normal HTTP API requests. See [here](#DOCS_REFERENCE/http-api) for further information. + There are a number of ways you can respond to an interaction: ### Interaction Response Object