From d443c24fff3746a24baf11e2f55b8a75027f3676 Mon Sep 17 00:00:00 2001 From: advaith Date: Thu, 3 Oct 2024 22:18:14 -0700 Subject: [PATCH 1/2] fix typo reponse --- docs/interactions/Receiving_and_Responding.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/interactions/Receiving_and_Responding.mdx b/docs/interactions/Receiving_and_Responding.mdx index 31e5290453..c3777ecd12 100644 --- a/docs/interactions/Receiving_and_Responding.mdx +++ b/docs/interactions/Receiving_and_Responding.mdx @@ -292,7 +292,7 @@ r = requests.post(url, json=json) > info > Interaction `tokens` are valid for **15 minutes** and can be used to send followup messages but you **must send an initial response within 3 seconds of receiving the event**. If the 3 second deadline is exceeded, the token will be invalidated. - + Your server can also respond to the received `POST` request. You'll want to respond with a `200` status code (if everything went well), as well as specifying a `type` and `data`, which is an [Interaction Response](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING/interaction-response-object) object: ```py From dde8e4cc4f83d5f666d5db2aded40b79c8a40bf9 Mon Sep 17 00:00:00 2001 From: advaith Date: Thu, 3 Oct 2024 22:23:28 -0700 Subject: [PATCH 2/2] move line about gw interactions outside of http box --- docs/interactions/Receiving_and_Responding.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/interactions/Receiving_and_Responding.mdx b/docs/interactions/Receiving_and_Responding.mdx index c3777ecd12..f8c69e9b59 100644 --- a/docs/interactions/Receiving_and_Responding.mdx +++ b/docs/interactions/Receiving_and_Responding.mdx @@ -273,6 +273,8 @@ Not all message fields are currently supported. When responding to an interaction received, you can make a `POST` request to `/interactions///callback`. `interaction_id` is the unique id of that individual Interaction from the received payload. `interaction_token` is the unique token for that interaction from the received payload. +If you are receiving Interactions over the gateway, you **have to respond via HTTP**. Responses to Interactions **are not sent as commands over the gateway**. + **If you send this request for an interaction received over HTTP, respond to the original HTTP request with a 202 and no body.** ```py @@ -293,7 +295,7 @@ r = requests.post(url, json=json) > Interaction `tokens` are valid for **15 minutes** and can be used to send followup messages but you **must send an initial response within 3 seconds of receiving the event**. If the 3 second deadline is exceeded, the token will be invalidated. - Your server can also respond to the received `POST` request. You'll want to respond with a `200` status code (if everything went well), as well as specifying a `type` and `data`, which is an [Interaction Response](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING/interaction-response-object) object: + If you receive interactions over HTTP, your server can also respond to the received `POST` request. You'll want to respond with a `200` status code (if everything went well), as well as specifying a `type` and `data`, which is an [Interaction Response](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING/interaction-response-object) object: ```py @app.route('/', methods=['POST']) @@ -314,8 +316,6 @@ r = requests.post(url, json=json) } }) ``` - - If you are receiving Interactions over the gateway, you **have to respond via HTTP**. Responses to Interactions **are not sent as commands over the gateway**. ###### Interaction Callback Response Object