Setting up notifications - Amazon WorkDocs (original) (raw)

You follow this process to set up notifications:

  1. Set IAM User or Role permissions to allow caller access to notification subscription management APIs.
  2. Call the notification subscription APIs to enable or disable publishing of SNS messages to your endpoint.
Note

For greater security, create federated users instead of IAM users whenever possible.

To set IAM user permissions
{  
    "Version": "2012-10-17",  
    "Statement": [  
        {  
        "Effect": "Allow",  
        "Action": [  
            "workdocs:CreateNotificationSubscription",  
            "workdocs:DeleteNotificationSubscription",  
            "workdocs:DescribeNotificationSubscriptions"  
            ],  
        "Resource": "*"  
        }  
    ]  
}  
To enable notifications

Enabling notifications allows you to call CreateNotificationSubscription after you subscribe to notifications.

  1. Open the Amazon WorkDocs console at https://console.aws.amazon.com/zocalo/.
  2. On the Manage Your WorkDocs Sites page, select the desired directory and choose Actions and thenManage Notifications.
  3. On the Manage Notifications page, choose Enable Notifications.
  4. Enter the ARN for the user or role you want to allow to receive notifications from your Amazon WorkDocs site.

For information about enabling Amazon WorkDocs to use notifications, see Using the Amazon WorkDocs API with the AWS SDK for Python and AWS Lambda. Once you enable notifications, you and your user can subscribe to them.

To subscribe to WorkDocs notifications
  1. Prepare your endpoint to process Amazon SNS messages. For more information, see Fanout to HTTP/S endpoints in the_Amazon Simple Notification Service Developer Guide_.
Important

SNS sends a confirmation message to your configured endpoint. You must confirm this message in order to receive notifications. Also, if you require FIPS 140-2 validated cryptographic modules when accessing AWS through a command line interface or an API, use a FIPS endpoint. For more information about the available FIPS endpoints, see Federal Information Processing Standard (FIPS) 140-2. 2. Do the following:

CreateNotificationSubscriptionRequest request = new CreateNotificationSubscriptionRequest();  
request.setOrganizationId("d-1234567890");  
request.setProtocol(SubscriptionProtocolType.Https);  
request.setEndpoint("https://my-webhook-service.com/webhook");  
request.setSubscriptionType(SubscriptionType.ALL);  
CreateNotificationSubscriptionResult result = amazonWorkDocsClient.createNotificationSubscription(request);  
System.out.println("WorkDocs notifications subscription-id: " result.getSubscription().getSubscriptionId());  
SNS Notifications

The message includes the following information:

To disable notifications
  1. Open the Amazon WorkDocs console at https://console.aws.amazon.com/zocalo/.
  2. On the Manage Your WorkDocs Sites page, select the desired directory and choose Actions and thenManage Notifications.
  3. On the Manage Notifications page, select the ARN that you wish to disable notifications for and choose Disable Notifications.