slackapi / java-slack-sdk

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

How do I respond to the url_verification event? #1317

Closed deeyonn closed 1 month ago

deeyonn commented 1 month ago

Can someone please explain to me how can I respond to the url_verification event when there is no such even found under com.slack.api.model.event?, but there are com.slack.api.app_backend.events.payload.UrlVerificationPayload and com.slack.api.bolt.request.builtin.UrlVerificationRequest.

App app = new App();
app.event(UrlVerificationPayload.class, (req, ctx) -> {return...});
App app = new App();
app.event(UrlVerificationRequest.class, (req, ctx) -> {return...});
zimeg commented 1 month ago

Hey @deeyonn 👋 Thanks for writing in and I'm glad to see this issue could be closed - hopefully with a fix! Could you share the solution you found? It's not immediately obvious to me what the correct response or handling might be 😅

deeyonn commented 1 month ago

Hey @deeyonn 👋 Thanks for writing in and I'm glad to see this issue could be closed - hopefully with a fix! Could you share the solution you found? It's not immediately obvious to me what the correct response or handling might be 😅

Not sure if its actually implemented, but simply instantiating the App with both mandatory environment variables allowed me to resolve the challenge automatically. I've tried it with ngrok and simply did something like:

App app = new App();
app.start();

and gave slack my ngrok endpoint and it verified so I suppose there's some auto url verification implementated somewhere in bolt.