Reputation: 1695
I want to create a slack message button and I understand that when the user clicks this button, Slack performs a callback to your app's "action URL" (called "request URL" in app's Interactive Messages settings).
Can I somehow specify this URL dynamically? If not, how do people deal with staging/test servers, etc?
Upvotes: 2
Views: 2931
Reputation: 32697
No, you can not provide / set the action URL by script. It has to be entered manually on the config pages for your Slack app.
I have 3 stages (Development, Test, Production) and the way I deal with staging is that I create one clone of my Slack app for each stage. That allows me to specify a different Action URL (and any other request URLs, like slash commands, interactive buttons etc.) for each stage.
Note that if you want to run all clones in the same Slack team you might need to rename some of your artifact, e.g. slash commands or bot users accordingly.
Example: For my Slack app rafflebot I use the slash command /raffle
. That becomes /raffle_t
for my test environment and /raffle_d
for my development environment.
Upvotes: 3