- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
CreateNotificationSubscriptionCommand
Configure Amazon WorkDocs to use Amazon SNS notifications. The endpoint receives a confirmation message, and must confirm the subscription.
For more information, see Setting up notifications for an IAM user or role in the Amazon WorkDocs Developer Guide.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { WorkDocsClient, CreateNotificationSubscriptionCommand } from "@aws-sdk/client-workdocs"; // ES Modules import
// const { WorkDocsClient, CreateNotificationSubscriptionCommand } = require("@aws-sdk/client-workdocs"); // CommonJS import
const client = new WorkDocsClient(config);
const input = { // CreateNotificationSubscriptionRequest
OrganizationId: "STRING_VALUE", // required
Endpoint: "STRING_VALUE", // required
Protocol: "HTTPS" || "SQS", // required
SubscriptionType: "ALL", // required
};
const command = new CreateNotificationSubscriptionCommand(input);
const response = await client.send(command);
// { // CreateNotificationSubscriptionResponse
// Subscription: { // Subscription
// SubscriptionId: "STRING_VALUE",
// EndPoint: "STRING_VALUE",
// Protocol: "HTTPS" || "SQS",
// },
// };
CreateNotificationSubscriptionCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
Endpoint Required | string | undefined | The endpoint to receive the notifications. If the protocol is HTTPS, the endpoint is a URL that begins with |
OrganizationId Required | string | undefined | The ID of the organization. |
Protocol Required | SubscriptionProtocolType | undefined | The protocol to use. The supported value is https, which delivers JSON-encoded messages using HTTPS POST. |
SubscriptionType Required | SubscriptionType | undefined | The notification type. |
CreateNotificationSubscriptionCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Subscription | Subscription | undefined | The subscription. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InvalidArgumentException | client | The pagination marker or limit fields are not valid. |
ServiceUnavailableException | server | One or more of the dependencies is unavailable. |
TooManySubscriptionsException | client | You've reached the limit on the number of subscriptions for the WorkDocs instance. |
UnauthorizedResourceAccessException | client | The caller does not have access to perform the action on the resource. |
WorkDocsServiceException | Base exception class for all service exceptions from WorkDocs service. |