title: How to verify Slack Events API Request Url in ASP.Net Core Mvc application?
body: <p>I'm working on Slack integration in an ASP.Net Core MVC 2 application. </p>
  
  <p>I have done it for Searching and Posting messages to Slack channels. Now I'm stuck at integrating Events API in this application. Basically, at the moment I'm not able to verify my Request Url as mentioned here <a href="https://api.slack.com/events-api#subscriptions" rel="nofollow noreferrer">Events API Subscription</a></p>
  
  <p>Following is my action method that we have give to Slack where they will send the verification json object which will be mapped to request parameter of my action and is as follows:</p>
  
  <pre><code>{
  "token": "Jhj5dZrVaK7ZwHHjRyZWjbDl",
  "challenge": "3eZbrw1aBm2rZgRNFdxV2595E9CY3gmdALWMmHkvFXO7tYXAYM8P",
  "type": "url_verification"
  }
  
  [HttpPost]
      public IActionResult Event(EventsRequest request)
      {
          if (request != null)
          {
              if (request.type.Equals("url_verification"))
                  return Content(request.challenge);
              else
                  ViewBag.Challenge = request.challenge;
          }
          return View();
      }
  </code></pre>
  
  <p>Here is my EventsRequest class:</p>
  
  <pre><code>public class EventsRequest
  {
      public string token { get; set; }
      public string challenge { get; set; }
      public string type { get; set; }
  }
  </code></pre>
  
  <p>I have deployed this application locally on IIS and have applied InBound rules to make it accessible publicly and it is accessible. But issues arise when I give the following URL to Slack for verification:</p>
  
  <blockquote>
    <p><a href="http://IP_Address/Slack/Event" rel="nofollow noreferrer">http://IP_Address/Slack/Event</a></p>
  </blockquote>
  
  <p>Following is the screenshot of the response that Slack gives
  <a href="https://i.stack.imgur.com/RMEiO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RMEiO.png" alt="enter image description here"></a></p>
  
  <p>Can someone tell what's wrong here? I tried to hit this URL with Postman and I was able to get the desired results.</p>