Query Event Subscriptions
Important
The Buy with Prime API is offered as a preview and might change as we receive feedback and iterate on the interfaces. We are sharing this early documentation to help you learn about the Buy with Prime API as we write and iterate on the content.
This topic contains examples of requests and responses that show how to query your subscriptions to Buy with Prime events.
To learn how to call the Buy with Prime API, see Call the Buy with Prime API.
For troubleshooting, see Troubleshoot Events.
Get an event subscription
The following example uses the eventSubscription
query to get the details of a subscription with the specified subscriptionId
.
Request
// GraphQL query
query {
eventSubscription(subscriptionId:"example-subscription-id") {
subscriptionId
eventSubscriptionDetails {
destination {
__typename
... on EventBridgeData {
arn
}
}
eventType
}
targetId
}
}
Response
{
"data": {
"eventSubscription": {
"subscriptionId": "example-subscription-id",
"eventSubscriptionDetails": {
"destination": {
"__typename": "EventBridgeData",
"arn": "arn:aws:events:us-east-1::event-source/aws.partner/buywithprime/example-event-source"
},
"eventType": "REFUND_REQUESTED"
},
"targetId": "example-target-id"
}
}
}
List event subscriptions
The following example uses the eventSubscriptions
query to find the subscriptions you have created. The response lists all of the subscription IDs. If you then want more information about a particular subscription, you can get an event subscription.
Request
// GraphQL query
query{
eventSubscriptions{
edges{
node{
id
}
}
totalCount
}
}
Response
{
"data": {
"eventSubscriptions": {
"edges": [
{
"node": {
"id": "example-subscription-id-1"
}
},
{
"node": {
"id": "example-subscription-id-2"
}
},
{
"node": {
"id": "example-subscription-id-3"
}
}
],
"totalCount": 3
}
}
}
Related topics
Updated about 17 hours ago