Skip to content

Commit 68e58df

Browse files
authored
update http interaction response collapsible box (#7192)
1 parent 4393b4f commit 68e58df

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/interactions/Receiving_and_Responding.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,8 @@ Not all message fields are currently supported.
273273

274274
When responding to an interaction received, you can make a `POST` request to `/interactions/<interaction_id>/<interaction_token>/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.
275275

276+
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**.
277+
276278
**If you send this request for an interaction received over HTTP, respond to the original HTTP request with a 202 and no body.**
277279

278280
```py
@@ -292,8 +294,8 @@ r = requests.post(url, json=json)
292294
> info
293295
> 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.
294296
295-
<Collapsible title="Inline HTTP Reponse Behavior" icon="code">
296-
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:
297+
<Collapsible title="Inline HTTP Response Behavior" icon="code">
298+
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:
297299

298300
```py
299301
@app.route('/', methods=['POST'])
@@ -314,8 +316,6 @@ r = requests.post(url, json=json)
314316
}
315317
})
316318
```
317-
318-
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**.
319319
</Collapsible>
320320

321321
###### Interaction Callback Response Object

0 commit comments

Comments
 (0)