subscriptions: Subscribe/Unsubscribe to a topic

subscribeR Documentation

Subscribe/Unsubscribe to a topic

Description

Subscribes an endpoint to the specified SNS topic.

Usage

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

## Not run: 
  top <- create_topic("new_topic")
  # email subscription
  subscribe(top, "example@example.com", protocol = "email")

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

  delete_topic(top)

## End(Not run)


cloudyr/aws.sns documentation built on June 26, 2022, 4:04 a.m.