Answer a slash command
POST
Terminal window
/api/public/apps/responses/{token}
Needs the commands permission on the app. The secret URL is the credential: send no token.
Posts the app’s answer to the person who ran the command: privately by default, or in the channel as the app with response_type: in_channel. The URL comes in the command’s response_url, works for 30 minutes and up to 5 times, and needs no token.
Parameters
Section titled “Parameters”| Name | In | Required | Meaning |
|---|---|---|---|
token |
path | yes | string |
| Field | Type | Required | Meaning |
|---|---|---|---|
text |
string | yes | Markdown. Up to 8000 characters. |
response_type |
ephemeral or in_channel |
no |
Example
Section titled “Example”curl -X POST "https://amedeus.app/api/public/apps/responses/<secret>" \ -H 'Content-Type: application/json' \ -d '{"text":"…"}'const response = await fetch("https://amedeus.app/api/public/apps/responses/<secret>", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({"text":"…"}),});const result = await response.json(); // { ok: true, … } or { ok: false, error, message }import jsonimport urllib.request
request = urllib.request.Request( "https://amedeus.app/api/public/apps/responses/<secret>", data=json.dumps({"text":"…"}).encode(), headers={ "Content-Type": "application/json", "User-Agent": "my-app/1.0", }, method="POST",)with urllib.request.urlopen(request) as response: result = json.load(response) # a 4xx or 5xx raises urllib.error.HTTPErrorResponse
Section titled “Response”| Field | Type | Required | Meaning |
|---|---|---|---|
ok |
true |
yes |
{ "ok": true}Errors
Section titled “Errors”Failures answer { "ok": false, "error": "<code>", "message": "…" }; see Errors.
400: The request isn’t valid.403: A missing scope (the message names it), or a channel the app isn’t in.404: The URL is wrong or has expired.429: Slow down;Retry-Aftersays for how many seconds.