Creating and attaching webhooks

After you specify third-party gateway details in Developer Portal, you must configure a webhook to enable communication between the two.

About this task

Developer Portal uses the webhook to communicate with the gateway during the following events:
  • Creation of Gateway application
  • Increase in application scope
  • Decrease in application scope
  • Update of application

Procedure

  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 Webhooks.

    You can also create webhooks by using the Developer Portal UI. For information about creating webhooks by using UI, see Configuring webhooks.

  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"
    }

What to do next