subscriptions: Subscribe/Unsubscribe to a topic

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Subscribes an endpoint to the specified SNS topic.

Usage

1
2
3
subscribe(topic, endpoint, protocol, ...)

unsubscribe(subscription, ...)

Arguments

topic

A character string containing an SNS Topic Amazon Resource Name (ARN).

endpoint

A character string containing the endpoint to be subscribed (e.g., an email address).

protocol

The allowed protocol types are: default, email, email-json, sqs, sms, http, https, and application.

...

Additional arguments passed to snsHTTP.

subscription

A character string containing an SNS Subscription Amazon Resource Name (ARN).

Details

subscribe initiates a subscription of an endpoint to an SNS topic. For example, this is used to add an email address endpoint to a topic. Subscriptions need to be confirmed by the endpoint. For example, an SMS endpoint will require an SMS response to an subscription invitation message. Subscriptions can be removed using unsubscribe (or whatever method is described in the invitation message); thus subscriptions can be handled by both users and administrator (you).

unsubscribe unsubscribes an endpoint from an SNS topic.

Value

If successful, a character string containing a subscription ARN. Otherwise, a data structure of class “aws_error” containing any error message(s) from AWS and information about the request attempt.

Author(s)

Thomas J. Leeper

References

Subscribe Unsubscribe

See Also

list_subscriptions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
  top <- create_topic("new_topic")
  # email subscription
  subscribe(top, "example@example.com", protocol = "email")

  # sms subscription
  subscribe(top, "555-123-4567", protocol = "sms")

  delete_topic(top)

## End(Not run)

aws.sns documentation built on May 2, 2019, 9:31 a.m.