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

Slack client response_url usage #270

Closed
5 of 9 tasks
chubz opened this issue Jan 15, 2018 · 4 comments
Closed
5 of 9 tasks

Slack client response_url usage #270

chubz opened this issue Jan 15, 2018 · 4 comments
Assignees
Labels
enhancement M-T: A feature request for new functionality Version: 2x web-client
Milestone

Comments

@chubz
Copy link

chubz commented Jan 15, 2018

Description

Using response_url in SlackClient

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • testing related
  • discussion

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

I cannot find anywhere how to utilize response_url with SlackClient.
I'm trying to queue a message that would replace the currently displayed message to the user if there is no action taken within 30 seconds.
The original initial message I'm sending is of ephemeral type. I've read that you cannot directly delete/update those using api_call("chat.update") or api_call("chat.delete").
However, from slack docs it seems it is possible to modify/replace that message using the specific response_url provided by user click a message button.

Does slack client provide any wrapper for using response_url that I'm missing? If it doesn't have anything utilizing response_url is it plausible to work it in the client api?

So if anyone wants they could call something like:
client.respond_to(response_url, **kwrags)

It seems like something that would provide wider utilization of the standard client.

@Roach
Copy link
Contributor

Roach commented Jan 22, 2018

@chubz response_url is a separate bit of functionality outside of the Web API. You'd need to use requests directly for that URL: http://docs.python-requests.org/en/latest/index.html

@Roach Roach self-assigned this Jan 22, 2018
@chubz
Copy link
Author

chubz commented Jan 22, 2018

I realize that and I did end up using requests to make the call I needed.
However, the response_url receives an api_call like payload and exposes an api_call-"ish" interface.
As for it not being part of the WEB API, neither is rtm.
This is more a question regarding support for these "advanced" calls that slack is expanding with (Events API etc.). Since this is a recommended/official client.

@seratch
Copy link
Member

seratch commented May 20, 2020

I'll be adding a new class that provides a handy way to use webhooks and response_urls soon.

seratch added a commit to seratch/python-slack-sdk that referenced this issue May 28, 2020
seratch added a commit to seratch/python-slack-sdk that referenced this issue May 28, 2020
seratch added a commit to seratch/python-slack-sdk that referenced this issue May 28, 2020
@seratch seratch closed this as completed in c7d0be8 Jun 2, 2020
seratch added a commit that referenced this issue Jun 2, 2020
Fix #270 by adding a new module for incoming webhook and response_url
@ruberVulpes
Copy link
Contributor

@seratch The webhook class is pretty cool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement M-T: A feature request for new functionality Version: 2x web-client
Projects
None yet
Development

No branches or pull requests

5 participants