Subscriptions
Subscriptions are the way to manage your webhooks programmatically. On this page, we'll dive into the different subscription endpoints you can use to manage subscriptions programmatically. We'll look at how to query, create and delete subscriptions.
The subscription model
The subscription model contains all the information about subscriptions, such as their name, notificationUrl, and the event the hook is for.
Properties
- Name
id
- Type
- string
- Description
Unique identifier for the subscription.
- Name
notificationUrl
- Type
- string
- Description
The url that will called when the hook is activated.
- Name
event
- Type
- string
- Description
The event that triggers this subscription.
List all subscriptions
This endpoint allows you to retrieve a list of all subscriptions.
Request
curl -G https://lml-api.studiewinkel.nl/api/lml/v1/subscriptions \
-H "Authorization: Bearer {token}" \
Response
{
"has_more": false,
"data": [
{
"id": "clf29lzon000h8rj700avuas6",
"notificationUrl": "https://yourdomain.com/hook",
"event": "list-status",
},
{
"id": "clf29lzon000h8rj700avuad1"
// ...
}
]
}
Create a subscription
This endpoint allows you to add a new subscription. To add a subscription, you must provide the event
and notificationUrl
.
Required attributes
- Name
event
- Type
- string
- Description
The event that triggers this subscription.
- Name
notificationUrl
- Type
- string
- Description
The url that will called when the hook is activated.
Request
curl https://lml-api.studiewinkel.nl/api/lml/v1/subscriptions \
-H "Authorization: Bearer {token}" \
-d `{
"event": "list-published",
"notificationUrl": "https://yourserver.yourdomain.com/logger"
}
Response
{
"id": "clgmb2uv6000160xlugi6jkmt",
"notificationUrl": "hhttps://yourserver.yourdomain.com/logger",
"event": "list-published"
}
Retrieve a subscription
This endpoint allows you to retrieve a subscripiton by providing the unique identifier. Refer to the list at the top of this page to see which properties are included with subscription objects.
Request
curl https://lml-api.studiewinkel.nl/api/lml/v1/subscriptions/clgmb2uv6000160xlugi6jkmt \
-H "Authorization: Bearer {token}"
Response
{
"id": "clgmb2uv6000160xlugi6jkmt",
"notificationUrl": "hhttps://yourserver.yourdomain.com/logger",
"event": "list-published"
}
Delete a subscription
This endpoint allows you to delete subscriptions.
Request
curl -X DELETE https://lml-api.studiewinkel.nl/lml/v1/subscriptions/clgmb2uv6000160xlugi6jkmt \
-H "Authorization: Bearer {token}"