title: Example SNS subscription confirmation using AWS .NET SDK
body: <p>I am trying to figure out how to use the AWS .NET SDK to confirm a subscription to a SNS Topic.</p>
  
  <p>The subscription is via HTTP</p>
  
  <p>The endpoint will be in a .net mvc website.</p>
  
  <p>I can't find any .net examples anywhere?</p>
  
  <p>A working example would be fantastic.</p>
  
  <p>I'm trying something like this</p>
  
  <pre><code> Dim snsclient As New Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient(ConfigurationSettings.AppSettings("AWSAccessKey"), ConfigurationSettings.AppSettings("AWSSecretKey"))
  
      Dim TopicArn As String = "arn:aws:sns:us-east-1:991924819628:post-delivery"
  
  
      If Request.Headers("x-amz-sns-message-type") = "SubscriptionConfirmation" Then
  
          Request.InputStream.Seek(0, 0)
          Dim reader As New System.IO.StreamReader(Request.InputStream)
          Dim inputString As String = reader.ReadToEnd()
  
          Dim jsSerializer As New System.Web.Script.Serialization.JavaScriptSerializer
          Dim message As Dictionary(Of String, String) = jsSerializer.Deserialize(Of Dictionary(Of String, String))(inputString)
  
          snsclient.ConfirmSubscription(New Amazon.SimpleNotificationService.Model.ConfirmSubscriptionRequest With {.AuthenticateOnUnsubscribe = False, .Token = message("Token"), .TopicArn = TopicArn})
  
  
     End If
  </code></pre>