Closed rorhug closed 9 years ago
Thanks for pointing this out! We have this on our list to look into. If you notice anything else in future, we'll be happy to help. You can let us know by emailing feedback@slack.com where we'll be able to get you a faster reply, though we'll be keeping an eye on issues here, too. Thank you again!
hitting this issue too in the ruby gem (doesn't allow to post without text)
Hi,
I am having issues with chat.postMessage not working with attachments parameter. It stopped working around 4th-5th February. These are the return values. { error: "no_text", ok: false}
Attachments should work regardless of the text parameter. Is there any workaround or fix for this?
Hi,
Even though
https://slack.com/api/chat.postMessage
is documented to require atext
parameter it can actually succeed with notext
and onlyattachments
.This is an issue because some libraries use the json in the docs to automatically code for api wrapping (with validations) and therefore they don't allow submission of
attachments
only.dblock/slack-ruby-client#11
Example Request
https://slack.com/api/chat.postMessage?token=YOUR_TOKEN&channel=YOUR_CHANNEL_ID&attachments=%5B%7B%22title%22%3A%20%22hi%22%7D%5D
(
&attachments
is encoding the json string[{"title": "hi"}]
)Once YOUR_TOKEN and YOUR_CHANNEL_ID have been replaced by a valid values, it will submit a message with attachment to the channel without any text parameter. Removing the attachment gives the error
which should really be something like
no_text_or_attachment
.