0
votes

I'm not sure if I'm understanding what slack means by a post request.

In my experience with what I'm familiar with it's either a curl request POST or with PHP use something like:

if ($_SERVER['REQUEST_METHOD'] === 'POST'){
  // get token
  $token = $_POST['token'];
}

I'm not receiving anything from Slack though, Is it a cors problem? I tried that I enabled headers. I saw other questions, I can't seem to find much on this topic.

how to handle outgoing-webhook (Slack) using php

Slack outgoing webhook :URL(s)

I selected a channel, I also put in a trigger word, the return text is not related to the trigger word. Maybe by returning the text it's triggering/causing a loop? I just tried that no dice as well. There are no errors in apache, the code itself works, when I visit the link directly on my server it processes the code.

The incoming webhooks are no problem.

I don't understand I've tried this many times could never get it to work what am I missing?

Regarding the headers I wasn't sure what domain to match to, I didn't enable all (the star *) so I tried slack.com but it's possible that's not what slack uses to send out the request.

1

1 Answers

0
votes

I am also learning on this, and there's not much documentation anywhere. I tried it yesterday. I sent a text with trigger words like "try send abcd". Based on the posted data to my public URL it will match the trigger word try with text "try send abcd". This text will be posted to the URL I provide in configuration and I catch the posted data like what's slack described in their docs with api response json raw body.

Anyway, the channel and url provided must be public and you need to provide a trigger words too. what's the posted data sent to your URL?

So far that's what I can do. I also plan to fetch them via js fetch(). if you've got any information on this kindly share it with me :)