Back in the Slack console, under the Event Subscriptions page, we will add the endpoint of our chatbot API to the Request URL field. In the following, you can see we are receiving a 500 error:
This happens because, when we subscribe to events, Slack will send a URL verification object to the request URL. Our code doesn't cater for this yet, so we need to add that as a feature. The object that Slack sends for verification looks like this:
{ "token":"GveYU40cwJ3NPGNM4MnVYHEe", "challenge":"Bo0A0QRp5Z7lUILCWfIA284rCQ32cyAkfADRyVNQRopVb2HIutgv", "type":"url_verification"}