error: no_text being printed in the log
- [X] I've read and understood the Contributing guidelines and have done my best effort to follow them.
- [X] I've read and agree to the Code of Conduct.
- [X] I've searched for any related issues and avoided creating a duplicate issue.
Description
I'm getting a log error: no_text whenever I use webclient.chat.postMessage only with attachments, without providing any text.
This is bit annoying and adds trash to the log.
it turns out text actually is optional if you add an attachment. i can see how the API of this SDK makes using this functionality difficult. i think the best way to address this would actually be with #381
Hi,
I am having the same issue 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?
@raoradica 👋Sorry you've had recent problems sending attachments - I'm looking into it to determine if something on our end caused this error to recently pop up.
In the meantime, it'd be really helpful if you could provide your message payload so I can try to reproduce this myself. I tried a few different payloads but wasn't able to get the same error while using attachments.
Hi Shane,
Here are the details.

1st log is attachment object
2nd is the attachment object stringified using JSON.stringify: {"attachments":[{"footer":"Narenthira Rao","footer_icon":" https://vecta.io/images/Vectalogo_notif.png","ts":1550644742.832,"title":"Untitled drawing created ","title_link":" http://vecta.test/app/edit/-LZ8cDj-G3LvItm06JJP"}]}
3rd is the stringified json presented as a URL encoded string using encodeURIComponent(): %7B%22attachments%22%3A%5B%7B%22footer%22%3A%22Narenthira%20Rao%22%2C%22footer_icon%22%3A%22https%3A%2F%2Fvecta.io%2Fimages%2FVectalogo_notif.png%22%2C%22ts%22%3A1550644742.832%2C%22title%22%3A%22Untitled%20drawing%20created%20%22%2C%22title_link%22%3A%22http%3A%2F%2Fvecta.test%2Fapp%2Fedit%2F-LZ8cDj-G3LvItm06JJP%22%7D%5D%7D
4th is the slack response data.
My ajax:
I removed my token and channel id , Please let me know if you guys need
more information. Thank you.
Regards,
On Thu, Feb 21, 2019 at 3:54 AM Shane DeWael [email protected] wrote:
@raoradica https://github.com/raoradica 👋Sorry you've had recent problems sending attachments - I'm looking into it to determine if something on our end caused this error to recently pop up.
In the meantime, it'd be really helpful if you could provide your message payload so I can try to reproduce this myself. I tried a few different payloads but wasn't able to get the same error while using attachments.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/slackapi/node-slack-sdk/issues/321#issuecomment-465729714, or mute the thread https://github.com/notifications/unsubscribe-auth/AflaC5J67leqkRnOS1Ii9C2zVbDyqTN_ks5vPafjgaJpZM4MI3Ue .
I was able to reproduce this issue using the API tester on api.slack.com. This is a platform issue, and not an issue in the SDK.
@raoradica your code is using jQuery's $.ajax(), not the WebClient of this package. We'll try to help you out, but this issue doesn't really belong here.
this issue comes down to the fact that you're sending arguments as GET params (also known as query params) using a POST request. this isn't strictly wrong, but it's not how most people would use the API. the problem can be avoided if you put the arguments in the request body (as how POST requests typically are used). an even easier solution: use the WebClient from this package. we serialize arguments in a supported (and often better, more secure) way.
Hi Ankur,
Sorry for posting at the wrong place, was looking for immediate help. The problem: there was a change in how the attachment array is structured and sent out but the documentation was not updated. The docs stated prefer POST( https://api.slack.com/methods/chat.postMessage). I already contacted the slack support about it, and hopefully they will make changes needed. And upcoming https://api.slack.com/messaging/composing is the preferred channel to refer to. Thanks again for the effort and suggestion, may consider the sdk in the near future.
On Wed, Feb 27, 2019 at 4:04 AM Ankur Oberoi [email protected] wrote:
I was able to reproduce this issue using the API tester on api.slack.com. This is a platform issue, and not an issue in the SDK.
@raoradica https://github.com/raoradica your code is using jQuery's $.ajax(), not the WebClient of this package. We'll try to help you out, but this issue doesn't really belong here.
this issue comes down to the fact that you're sending arguments as GET params (also known as query params) using a POST request. this isn't strictly wrong, but it's not how most people would use the API. the problem can be avoided if you put the arguments in the request body (as how POST requests typically are used). an even easier solution: use the WebClient from this package. we serialize arguments in a supported (and often better, more secure) way.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/slackapi/node-slack-sdk/issues/321#issuecomment-467592041, or mute the thread https://github.com/notifications/unsubscribe-auth/AflaC0VpfSfC5mBEmwm2ZBBjm9VX1Qirks5vRZNUgaJpZM4MI3Ue .