AWS SDK Version 2 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

.NET Framework 3.5
 
Prepares to subscribe an endpoint by sending the endpoint a confirmation message. To actually create a subscription, the endpoint owner must call the ConfirmSubscription action with the token from the confirmation message. Confirmation tokens are valid for three days.

Namespace: Amazon.SimpleNotificationService
Assembly: AWSSDK.dll
Version: (assembly version)

Syntax

C#
public virtual SubscribeResponse Subscribe(
         String topicArn,
         String protocol,
         String endpoint
)

Parameters

topicArn
Type: System.String

The ARN of the topic you want to subscribe to.

protocol
Type: System.String

The protocol you want to use. Supported protocols include: http -- delivery of JSON-encoded message via HTTP POSThttps -- delivery of JSON-encoded message via HTTPS POSTemail -- delivery of message via SMTPemail-json -- delivery of JSON-encoded message via SMTPsms -- delivery of message via SMSsqs -- delivery of JSON-encoded message to an Amazon SQS queueapplication -- delivery of JSON-encoded message to an EndpointArn for a mobile app and device.

endpoint
Type: System.String

The endpoint that you want to receive notifications. Endpoints vary by protocol: For the http protocol, the endpoint is an URL beginning with "http://"For the https protocol, the endpoint is a URL beginning with "https://"For the email protocol, the endpoint is an email addressFor the email-json protocol, the endpoint is an email addressFor the sms protocol, the endpoint is a phone number of an SMS-enabled deviceFor the sqs protocol, the endpoint is the ARN of an Amazon SQS queueFor the application protocol, the endpoint is the EndpointArn of a mobile app and device.

Return Value
Type: Amazon.SimpleNotificationService.Model.SubscribeResponse
The response from the Subscribe service method, as returned by SimpleNotificationService.

Exceptions

ExceptionCondition
AuthorizationErrorException Indicates that the user has been denied access to the requested resource.
InternalErrorException Indicates an internal service error.
InvalidParameterException Indicates that a request parameter does not comply with the associated constraints.
NotFoundException Indicates that the requested resource does not exist.
SubscriptionLimitExceededException Indicates that the customer already owns the maximum allowed number of subscriptions.

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5