Notifications Resource

All of the notifications endpoints are supported by this SDK.

Several of the endpoints use grantless authorization. This will be handled automatically, but if you would like to store/cache the access token rather than generate a new one for each call, you can follow the instructions in the authentication section.

Calling the method for the endpoint will return a data transfer object, from the Jasara\AmznSPA\DataTransferObjects\Responses\Notifications namespace. Read more about responses.

getSubscription

Usage

$response = $spa->notifications->getSubscription($notification_type); // GetSubscriptionResponse

Parameters

Parameter Type Examples Description
notification_type
Required
string (enum) ANY_OFFER_CHANGED A valid notification type from this list.

Payload: notifications/SubscriptionSchema

Key Type Examples Description
subscription_id string 7fcacc7e-727b-11e9-8848-1681be663d3e The subscription identifier generated when the subscription is created.
payload_version string 1.0 The version of the payload object to be used in the notification.
destination_id string 3acafc7e-121b-1329-8ae8-1571be663aa2 The identifier for the destination where notifications will be delivered.

createSubscription

Usage

$response = $spa->notifications->createSubscription($notification_type, $payload_version, $destination_id); // CreateSubscriptionResponse

Parameters

Parameter Type Examples Description
notification_type
Required
string (enum) ANY_OFFER_CHANGED A valid notification type from this list.
payload_version
Optional
string 1.0 The version of the payload object to be used in the notification.
destination_id
Optional
string 3acafc7e-121b-1329-8ae8-1571be663aa2 The identifier for the destination where notifications will be delivered.

Payload: notifications/SubscriptionSchema

Key Type Examples Description
subscription_id string 7fcacc7e-727b-11e9-8848-1681be663d3e The subscription identifier generated when the subscription is created.
payload_version string 1.0 The version of the payload object to be used in the notification.
destination_id string 3acafc7e-121b-1329-8ae8-1571be663aa2 The identifier for the destination where notifications will be delivered.

getSubscriptionById

Usage

$response = $spa->notifications->getSubscriptionById($notification_type, $subscription_id); // GetSubscriptionByIdResponse

Parameters

Parameter Type Examples Description
notification_type
Required
string (enum) ANY_OFFER_CHANGED A valid notification type from this list.
subscription_id
Required
string 7fcacc7e-727b-11e9-8848-1681be663d3e The subscription identifier generated when the subscription is created.

Payload: notifications/SubscriptionSchema

Key Type Examples Description
subscription_id string 7fcacc7e-727b-11e9-8848-1681be663d3e The subscription identifier generated when the subscription is created.
payload_version string 1.0 The version of the payload object to be used in the notification.
destination_id string 3acafc7e-121b-1329-8ae8-1571be663aa2 The identifier for the destination where notifications will be delivered.

deleteSubscriptionById

Usage

$response = $spa->notifications->deleteSubscriptionById($notification_type, $subscription_id); // DeleteSubscriptionByIdResponse

Parameters

Parameter Type Examples Description
notification_type
Required
string (enum) ANY_OFFER_CHANGED A valid notification type from this list.
subscription_id
Required
string 7fcacc7e-727b-11e9-8848-1681be663d3e The subscription identifier generated when the subscription is created.
No payload

getDestinations

Usage

$response = $spa->notifications->getDestinations(); // GetDestinationsResponse
No parameters

Payload: notifications/DestinationListSchema Collection

Key Type Examples Description
DestinationSchema.name string (max:256) SQSDestination The developer-defined name for this destination.
DestinationSchema.destination_id string 3acafc7e-121b-1329-8ae8-1571be663aa2 The destination identifier generated when you created the destination.
DestinationSchema.resource schema DestinationResourceSchema The resource that will receive notifications associated with this destination.
DestinationResourceSchema.sqs schema SqsResourceSchema An Amazon Simple Queue Service (SQS) queue destination.
DestinationResourceSchema.event_bridge schema SqsResourceSchema An Amazon EventBridge destination.
SqsResourceSchema.arn string (max: 1000) arn:aws:sqs:us-east-2:444455556666:queue1 The Amazon Resource Name (ARN) associated with the SQS queue.
EventBridgeResourceSchema.name string (max: 256) The name of the partner event source associated with the destination.
EventBridgeResourceSchema.region string The AWS region in which you receive the notifications. For AWS regions that are supported in Amazon EventBridge, see https://docs.aws.amazon.com/general/latest/gr/ev.html.
EventBridgeResourceSchema.account_id string The identifier for the AWS account that is responsible for charges related to receiving notifications.

createDestination

Usage

$response = $spa->notifications->createDestination($name, new DestinationResourceSpecificationSchema()); // CreateDestinationResponse

Parameters

Parameter Type Examples Description
name
Required
string (max:256) SQSDestination The developer-defined name for this destination.
resourceSpecification
Required
schema DestinationResourceSpecificationSchema The resource that will receive notifications associated with this destination.
DestinationResourceSpecificationSchema.sqs
Required
schema SqsResourceSchema An Amazon Simple Queue Service (SQS) queue destination.
DestinationResourceSpecificationSchema.event_bridge
Required
schema SqsResourceSchema An Amazon EventBridge destination.
SqsResourceSchema.arn
Required
string (max: 1000) arn:aws:sqs:us-east-2:444455556666:queue1 The Amazon Resource Name (ARN) associated with the SQS queue.
EventBridgeResourceSpecificationSchema.region
Required
string The AWS region in which you receive the notifications. For AWS regions that are supported in Amazon EventBridge, see https://docs.aws.amazon.com/general/latest/gr/ev.html.
EventBridgeResourceSpecificationSchema.account_id
Required
string The identifier for the AWS account that is responsible for charges related to receiving notifications.
No payload

getDestination

Usage

$response = $spa->notifications->getDestination($destination_id); // GetDestinationResponse

Parameters

Parameter Type Examples Description
destination_id
Required
string 3acafc7e-121b-1329-8ae8-1571be663aa2 The destination identifier generated when you created the destination.

Payload: notifications/DestinationSchema

Key Type Examples Description
name string (max:256) SQSDestination The developer-defined name for this destination.
destination_id string 3acafc7e-121b-1329-8ae8-1571be663aa2 The destination identifier generated when you created the destination.
resource schema DestinationResourceSchema The resource that will receive notifications associated with this destination.
DestinationResourceSchema.sqs schema SqsResourceSchema An Amazon Simple Queue Service (SQS) queue destination.
DestinationResourceSchema.event_bridge schema SqsResourceSchema An Amazon EventBridge destination.
SqsResourceSchema.arn string (max: 1000) arn:aws:sqs:us-east-2:444455556666:queue1 The Amazon Resource Name (ARN) associated with the SQS queue.
EventBridgeResourceSchema.name string (max: 256) The name of the partner event source associated with the destination.
EventBridgeResourceSchema.region string The AWS region in which you receive the notifications. For AWS regions that are supported in Amazon EventBridge, see https://docs.aws.amazon.com/general/latest/gr/ev.html.
EventBridgeResourceSchema.account_id string The identifier for the AWS account that is responsible for charges related to receiving notifications.

deleteDestination

Usage

$response = $spa->notifications->deleteDestination($destination_id); // DeleteDestinationResponse

Parameters

Parameter Type Examples Description
destination_id
Required
string 3acafc7e-121b-1329-8ae8-1571be663aa2 The destination identifier generated when you created the destination.
No payload