Last chance! 50% off unlimited learning
Sale ends in
Subscribes an endpoint to the specified SNS topic.
subscribe(topic, endpoint, protocol, ...)unsubscribe(subscription, ...)
A character string containing an SNS Topic Amazon Resource Name (ARN).
A character string containing the endpoint to be subscribed (e.g., an email address).
The allowed protocol types are: default, email, email-json, sqs, sms, http, https, and application.
Additional arguments passed to snsHTTP
.
A character string containing an SNS Subscription Amazon Resource Name (ARN).
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.
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.
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)
Run the code above in your browser using DataLab