slackapi / java-slack-sdk

Slack Developer Kit (including Bolt for Java) for any JVM language
https://tools.slack.dev/java-slack-sdk/
MIT License
578 stars 215 forks source link

Question on building a Spring Boot 3 based app #1190

Closed Harishkumarcratoflow closed 1 year ago

Harishkumarcratoflow commented 1 year ago
@PostMapping(value = "/slack-responseee", produces = MediaType.APPLICATION_JSON_VALUE)
public String responseAction(Object payload) {
    System.out.println("Object: " + payload.toString());
    return "";
}

Here is the issue :

First in my slack application, we have interactive buttons to get response from the other user. When the other user clicks the button, we have one endpoint to process that action even though the request (POST) is happening I have to process that slack payload as Object, but the request payload is returning null.

Why is that I am getting null as my payload. Is there any other alternative to print that payload as json? Screenshot (56)

image

seratch commented 1 year ago

Hi @Harishkumarcratoflow, thanks for writing in. However, this question is mostly the same with https://github.com/slackapi/java-slack-sdk/issues/1188 . As I replied in the question issue, we are unable to assist you for general Spring boot questions. If you're not sure about how to parse request data on your own, please consider using bolt-java's functionality to do so.