Skip to content

Commit

Permalink
CTC-2213 Add cURL webhook samples for MAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
jancerman committed Dec 14, 2023
1 parent efd5fff commit 8b6f931
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rest/management-api-v2/cm_api_v2_delete_webhook.curl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
curl --request DELETE \
--url https://manage.kontent.ai/v2/projects/<YOUR_ENVIRONMENT_ID>/webhooks-vnext/d53360f7-79e1-42f4-a524-1b53a417d03e \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-type: application/json'
4 changes: 4 additions & 0 deletions rest/management-api-v2/cm_api_v2_get_webhook.curl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
curl --request GET \
--url https://manage.kontent.ai/v2/projects/<YOUR_ENVIRONMENT_ID>/webhooks-vnext/5df74e27-1213-484e-b9ae-bcbe90bd5990- \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-type: application/json'
4 changes: 4 additions & 0 deletions rest/management-api-v2/cm_api_v2_get_webhooks.curl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
curl --request GET \
--url https://manage.kontent.ai/v2/projects/<YOUR_ENVIRONMENT_ID>/webhooks-vnext \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-type: application/json'
55 changes: 55 additions & 0 deletions rest/management-api-v2/cm_api_v2_post_webhook.curl
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
curl --request POST \
--url https://manage.kontent.ai/v2/projects/<YOUR_ENVIRONMENT_ID>/webhooks-vnext \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-type: application/json' \
--data '
{
"name": "Example",
"url": "https://example.com",
"secret": "secret",
"triggers": {
"delivery_api_content_changes": [
{
"type": "content_item_variant",
"operations": [
"publish",
"unpublish"
]
},
{
"type": "taxonomy",
"operations": [
"archive",
"restore",
"upsert"
]
}
],
"preview_delivery_api_content_changes": [
{
"type": "content_item_variant",
"operations": [
"archive",
"upsert"
]
},
{
"type": "taxonomy",
"operations": [
"archive",
"restore",
"upsert"
]
}
],
"workflow_step_changes": [
{
"type": "content_item_variant",
"transitions_to": [
{ "id": "b4363ccd-8f21-45fd-a840-5843d7b7f008" },
{ "id": "88ac5e6e-1c5c-4638-96e1-0d61221ad5bf" }
]
}
]
}
}'
4 changes: 4 additions & 0 deletions rest/management-api-v2/mapi_v2_disable_webhook.curl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
curl --request PUT \
--url https://manage.kontent.ai/v2/projects/<YOUR_ENVIRONMENT_ID>/webhooks-vnext/5df74e27-1213-484e-b9ae-bcbe90bd5990/disable \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-type: application/json'
4 changes: 4 additions & 0 deletions rest/management-api-v2/mapi_v2_enable_webhook.curl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
curl --request PUT \
--url https://manage.kontent.ai/v2/projects/<YOUR_ENVIRONMENT_ID>/webhooks-vnext/5df74e27-1213-484e-b9ae-bcbe90bd5990/enable \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-type: application/json'

0 comments on commit 8b6f931

Please sign in to comment.