請注意:Amazon WorkDocs 不再提供新客戶註冊和帳戶升級。在此處了解遷移步驟:如何從 WorkDocs 遷移資料
本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
設定通知
請遵循此程序來設定通知:
設定 IAM 使用者或角色許可,以允許發起人存取通知訂閱管理 APIs。
呼叫通知訂閱 APIs,以啟用或停用將 SNS 訊息發佈到您的端點。
注意
為了提高安全性,請盡可能建立聯合身分使用者,而不是 IAM 使用者。
設定 IAM 使用者許可
使用 IAM 主控台為使用者設定下列許可:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "workdocs:CreateNotificationSubscription", "workdocs:DeleteNotificationSubscription", "workdocs:DescribeNotificationSubscriptions" ], "Resource": "*" } ] }
啟用通知
啟用通知可讓您在訂閱通知後呼叫 CreateNotificationSubscription。
-
開啟 WorkDocs 主控台,網址為 https://https://console.aws.amazon.com/zocalo/
。 -
在 Manage Your WorkDocs Sites (管理您的 WorkDocs 網站) 頁面上,選擇想要的目錄並選擇 Actions (動作),然後選擇 Manage Notifications (管理通知)。
-
在 Manage Notifications (管理通知) 頁面,選擇 Enable Notifications (啟用通知)。
-
輸入您要允許 從 WorkDocs 網站接收通知之使用者或角色的 ARN。
如需有關啟用 WorkDocs 以使用通知的資訊,請參閱搭配適用於 Python 的 AWS 開發套件和 AWS Lambda 使用 Amazon WorkDocs API
若要訂閱 WorkDocs 通知
-
準備您的端點來處理 Amazon SNS 訊息。如需詳細資訊,請參閱《Amazon Simple Notification Service 開發人員指南》中的散發至 HTTP/S 端點。
重要
SNS 會將確認訊息傳送至您設定的端點。您必須確認此訊息才能接收通知。此外,如果您在透過命令列界面或 API 存取 AWS 時需要 FIPS 140-2 驗證的密碼編譯模組,請使用 FIPS 端點。如需有關 FIPS 和 FIPS 端點的更多相關資訊,請參閱聯邦資訊處理標準 (FIPS) 140-2 概觀
。 -
請執行下列操作:
取得組織 ID
在 AWS Directory Service 主控台
導覽窗格中,選取目錄。 與您的 Amazon WorkDocs 網站對應的目錄 ID 也做為該網站的組織 ID。
建立訂閱請求,如下所示:
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 通知
訊息包括下列資訊:
-
organizationId— 組織的 ID。 -
parentEntityType— 父系的類型 (Document|DocumentVersion|Folder)。 -
parentEntityId— 父系的 ID。 -
entityType— 實體的類型 (Document|DocumentVersion|Folder)。 -
entityId— 實體的 ID。 -
動作 — 動作,可以是下列其中一個值:
-
delete_document -
move_document -
recycle_document -
rename_document -
revoke_share_document -
share_document -
upload_document_version
-
若要關閉通知
-
開啟 WorkDocs 主控台,網址為 https://https://console.aws.amazon.com/zocalo/
。 -
在 Manage Your WorkDocs Sites (管理您的 WorkDocs 網站) 頁面上,選擇想要的目錄並選擇 Actions (動作),然後選擇 Manage Notifications (管理通知)。
-
在 Manage Notifications (管理通知) 頁面上,選擇您想要停用通知的 ARN,並選擇 Disable Notifications (停用通知)。