BugHunterUK
BugHunterUK

Reputation: 8968

Slack Slash Command - Passing custom POST paramater?

Is it possible to send POST data along with a Slash Command?

For example, when setting up a new Slash Command I can set the callback URL that will receive the POST data from Slack. In my case it's

http://example.com/wp-admin/admin-post.php

I am writing this as a Wordpress plugin, and in order to have the plugin parse the POST data I need to pass along an action variable in the POST data.

action=update_status

... so that the correct action is called:

add_action('admin_update_status', function() {
    // Parse POST
});

Is it possible to send a custom POST parameter with the slash command? Maybe something like:

/update action:update_status ProjectA is currently in Q/A

Upvotes: 1

Views: 744

Answers (1)

BugHunterUK
BugHunterUK

Reputation: 8968

I figured out I can also send the action parameter as a GET request like so:

http://example.com/wp-admin/admin-post.php?action=update_status

Upvotes: 2

Related Questions