Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending links #21

Open
kpaxman opened this issue Jan 27, 2017 · 2 comments
Open

Sending links #21

kpaxman opened this issue Jan 27, 2017 · 2 comments

Comments

@kpaxman
Copy link

kpaxman commented Jan 27, 2017

In theory, I should be able to send links using the format <http://example.com|Name of site> which is supposed to turn into a hyperlink with my chosen text to the provided URL. (See https://api.slack.com/docs/message-formatting - which is linked from the RTM API docs page under "formatting messages".)

In practice, this is displaying exactly as is. It seems that the string is getting encoded somewhere (e.g. < becomes &lt;), but I can't for the life of me find what's doing this in your source. Any tips on tracking this down and/or bypassing it?

@jclg
Copy link
Owner

jclg commented Jan 30, 2017

Yes, there is a problem with the documentation about this.
Please see slackhq/slack-api-docs#32

You can only use http://example.com to send a link with RTM.

In https://api.slack.com/rtm

The RTM API only supports posting simple messages formatted using our default message formatting mode. It does not support attachments or other message formatting modes. To post a more complex message as a user clients can call the chat.postMessage Web API method with as_user set to true.

So I think you can bypass this by using the chat.postMessage Web API in order to format your message properly.

@kpaxman
Copy link
Author

kpaxman commented Feb 3, 2017

What would I have to do to use the chat.postMessage Web API within your application? Or would this mean looking elsewhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants