Developer Portal 10.15 | Using Developer Portal | Providers | Third-party API Gateway Configuration | Creating and Attaching Webhook
 
Creating and Attaching Webhook
After you specify third-party gateway details in Developer Portal, you must configure a webhook to enable communication between the two. Developer Portal uses the webhook to communicate with the gateway during the following events:
*Gateway application creation
*Gateway application scope increase
*Gateway application scope decrease
*Gateway application update
*To create and attach webhooks
1. Create a webhook for the specified events by making a REST call to the following endpoint:
POST /rest/v1/hooks
Sample request
{
"url": "https://hookbin.com/NOjmeDg6o0ue8mNN8PxR",
"configuration_type": "PROVIDER",
"subscriptions": [
{
"id": "GATEWAY_APPLICATION_CREATION_REQUEST_EVENT"
},
{
"id": "GATEWAY_APPLICATION_SCOPE_INCREASE_REQUEST_EVENT"
},
{
"id": "GATEWAY_APPLICATION_SCOPE_DECREASE_REQUEST_EVENT"
},
{
"id": "GATEWAY_APPLICATION_UPDATION_REQUEST_EVENT"
}
]
}
Sample response
{
"id": "07522ff8-fccd-45a0-b934-0ab67dffdf86",
"_self": "/portal/rest/v1/hooks/07522ff8-fccd-45a0-b934-0ab67dffdf86"
}
For information about using the hooks REST API, see Managing webhooks.
You can also create webhooks using the Developer Portal UI. For information about creating webhooks using UI, see How do I configure webhooks to notify events to an external system?
2. Specify the provider Id in Developer Portal by making a REST call to the following endpoint:
PUT /rest/v1/providers/id
Sample request
PUT /portal/rest/v1/providers/cf864096-75c9-4d46-8002-923d8ebbcd67
{
"name": "X Gateway",
"owner": "200ceb26-807d-3bf9-9fd6-f4f0d1ca54d4",
"id": "cf864096-75c9-4d46-8002-923d8ebbcd67",
"providerRef": "cf864096-75c9-4d46-8002-923d8ebbcd67",
"stage": "X Gateway",
"type": "THIRD_PARTY",
"summary": "External Gateway",
"description": "External Gateway",
"webhooks": [
"07522ff8-fccd-45a0-b934-0ab67dffdf86"
]
}
Sample response
{
"name": "X Gateway",
"owner": "200ceb26-807d-3bf9-9fd6-f4f0d1ca54d4",
"id": "cf864096-75c9-4d46-8002-923d8ebbcd67",
"documentType": "PROVIDER",
"providerRef": "cf864096-75c9-4d46-8002-923d8ebbcd67",
"stage": "X Gateway",
"webhooks": [
"07522ff8-fccd-45a0-b934-0ab67dffdf86"
],
"type": "THIRD_PARTY",
"summary": "External Gateway",
"description": "External Gateway"
}
Next steps:
*Publish APIs for the gateway that you registered with Developer Portal. For more information, see Publishing APIs from Third-party Gateway to Developer Portal.