0
votes

From My application sending message in slack using chat.postmessage with a button inside json request. but when user clicks on button from slack it's not returning response on request URL.

https://api.slack.com/messaging/interactivity/enabling#responding_to_interactions

As mentioned here in above link, i have set the structure. set Request URL and also actions with callback id. in my app also set request URL method. i have checked that my application's request URL is working fine.

In attachment parameter passed json as below

[
  {
    "text": "Are you want to turn of this messages?",
    "fallback": "You are unable to turn off",
    "callback_id": "turn_off_message",
    "attachment_type": "default",
    "actions": [
      {
        "name": "turnoff",
        "text": "Turn Off",
        "type": "button",
        "value": "turnoff"
      }
    ]
  }
]

Once user click on Turn Off button, need a response on Request URL which i have set in Interactive Component.

Sorry, but based on the little information you have provided its pretty much impossible to help you. Please add the relevant part of your code. A typical error: Did you maybe use localhost as your endpoint? that would not work. - Erik Kalkoken
Getting errors like: Oh no, something went wrong. Please try that again. chat.attachmentAction not ok: invalid_action_url As in Slack we have Interactive Component to set Request URL and Actions, i want a call back on this Request URL when user click on button "Turn Off". My request URL is valid and working fine but response which i want from slack is not returning and getting errors - Akash Kathiriya
To test your endpoint is working 100% with Slack requests, I would suggest using postman. You can use it to send POST requests to your endpoint. Also, make sure your endpoint is reachable from the public Internet. - Erik Kalkoken
And please share the relevant part of you code in the question. - Erik Kalkoken