We had some trouble connecting error when submitting slack dialog (Slack API)
Asked Answered
F

1

12

I am building a slack app connected with a Symfony application that uses slash commands and dialogs as UI to create new users, accounts and projects and store them in a database.

I use a slash command to trigger a dialog with input fields and store the submitted data in a database, send a 'user successfully created' message to slack as well as a 200 response with an empty body, as described in the documentation. However, when I fill in the input fields and press submit, I receive an error message with 'We had some trouble connecting. Try again?'. This error also prevents the dialog from closing.

The submitted data is still received correctly by my application and stored to the database and the 'user successfully created'-message is also send correctly to slack. So the whole process seems to work correctly, the only problem is that the dialog doesn't close and shows the error message.

I also tried to immediately send a http 200 response, without processing the submitted data first and this gives the same error message.

Furfural answered 16/4, 2019 at 15:46 Comment(7)
Possible duplicate of Slack dialog doesn't close after form submissionBankruptcy
Thanks for your reply. I already send the 200 response with an empty body. I also tried to send an response with a list of input validation error, but results in the same error.Furfural
Then please add the relevant part of your code to the question. I think its the only way people will be able to help you find the bug.Bankruptcy
any update on this?Lurleen
@NebiMAydin: Try a 204 response and no body. This helped me solve the problem (using golang).Tiemroth
For those still getting this error, particularly with Flask apps - I found that setting the response mimetype to '' resolved the issue.Muricate
In django DRF returning a response with {} body closed the dialog for me.Watanabe
R
1

In Golang, the only thing that worked was responding with status 200 and empty body: w.Write(nil).

I am not sure which lang are you using but try responding with an empty body. Responding with 204 did not work for me.

Raddi answered 27/6, 2022 at 10:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.