View Webhooks List

View Webhooks List

View all Webhooks created under your account

API Endpoint

https://eu.cpaas.bics.com/api/v2/

Note: Few elements in the endpoint may change from service to service.

GET

{endpoint}developer/webhooks

PARAMETERS

name optional value
filter[name] Yes name of the webhok.

Example Request

cURL - cURL
curl --location --globoff '{endpoint}api/v2/developer/webhooks'

Kindly replace the token with your respective access_token.

Example Response

{
  "status": "OK",
  "code": 200,
  "message": "Created successfully",
  "data": [
    {
      "id": "180ebbb5-9b6f-4c51-a98a-**********",
      "name": "name of webhook",
      "uri": "https://example.com/",
      "secret": "*****",
      "verification_code": "*****",
      "status": "1",
      "created_at": "2022-10-19T07:40:13.000000Z",
      "updated_at": "2022-10-19T12:11:06.000000Z"
    }
  ],
  "links": {
    "first": "{endpoint}developer/webhooks?page=1",
    "last": "{endpoint}developer/webhooks?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "links": [
      {
        "url": null,
        "label": "« Previous",
        "active": false
      },
      {
        "url": "{endpoint}developer/webhooks?page=1",
        "label": "1",
        "active": true
      },
      {
        "url": null,
        "label": "Next »",
        "active": false
      }
    ],
    "path": "{endpoint}developer/webhooks",
    "per_page": 15,
    "to": 10,
    "total": 10
  }
}

Create a Webhook using post method under your account

API Endpoint

https://eu.cpaas.bics.com/api/v2/

Note: Few elements in the endpoint may change from service to service.

Note: If you are thinking to pass Webhook ID in request everytime instead you can create subscription for that event, refer to create subscription

POST

{endpoint}developer/webhooks

PARAMETERS

Name optional Descriptions
name No Enter the name of the webhook that you want to create.
uri No The URL of the server that will receive the webhook POST request.
status yes Enter 1 for active or 0 for inactive.
secret yes Enter the secret that You received as the secret.
token yes Verification token for the initial webhook verification challenge. EX:123456**

Example Request

cURL - cURL
curl --location --globoff '{endpoint}api/v2/developer/webhooks' \
--data '{
    "name": "webhook site",
    "uri": "https://webhook.site/510f634b-84c6-43c3-a176-dad45844bebc",
    "secret":"",
    "token": "",
    "status": 1
}'

Example Response

{
  "status": "OK",
  "code": 200,
  "message": "Created successfully",
  "data": {
    "id": "180ebbb5-9b6f-4c51-a98a-**********",
    "name": "name of webhook",
    "uri": "https://example.com/",
    "secret": "*****",
    "verification_code": "*****",
    "status": "1",
    "created_at": "2022-10-19T07:40:13.000000Z",
    "updated_at": "2022-10-19T12:11:06.000000Z"
  }
}

Edit a Webhook using put method under your account

API Endpoint

https://eu.cpaas.bics.com/api/v2/

Note: Few elements in the endpoint may change from service to service.

PUT

{endpoint}developer/webhooks/{id}

PARAMETERS

Name optional Descriptions
name No Enter the name of the webhook that you want to modify
uri No The URL of the server that will receive the webhook POST request.
status yes Enter 1 for active or 0 for inactive.
secret yes Enter the secret that You received as the secret.

Example Request

cURL - cURL
curl --location --globoff --request PUT '{endpoint}api/v2/developer/webhooks/{webhook_Id}' \
--data '{
    "name": "name of webhook",
    "uri": "https://www.example.com"
}'

Example Response

{
  "status": "OK",
  "code": 200,
  "message": "Updated successfully",
  "data": {
    "id": "180ebbb5-9b6f-4c51-a98a-**********",
    "name": "name of webhook",
    "uri": "https://example.com/",
    "secret": "*****",
    "verification_code": "*****",
    "status": "1",
    "created_at": "2022-10-19T07:40:13.000000Z",
    "updated_at": "2022-10-19T12:11:06.000000Z"
  }
}

To show a Webhook using get method under your account

API Endpoint

https://eu.cpaas.bics.com/api/v2/

Note: Few elements in the endpoint may change from service to service.

GET

{endpoint}developer/webhooks/{id}

Replace the {id} with the actual id of the webhook that you would like to see.

Example Request

cURL - cURL
curl --location --globoff '{endpoint}api/v2/developer/webhooks/{webhook_Id}'

Example Response

{
  "status": "OK",
  "code": 200,
  "message": "OK",
  "data": {
    "id": "38b5abba-9fd4-4a53-b540-ccfe5c13****",
    "name": "name of webhook",
    "uri": "https://example.com/",
    "secret": "***",
    "verification_code": "***",
    "status": 1,
    "created_at": "2022-10-19T11:37:24.000000Z",
    "updated_at": "2022-10-19T11:37:24.000000Z"
  }
}
{endpoint}developer/webhooks/{id}

Replace the {id} with the actual id of the webhook that you would like to delete.

Example Request

cURL - cURL
curl --location --globoff --request DELETE '{endpoint}api/v2/developer/webhooks/{webhook_Id}'

Example Response

{
  "status": "OK",
  "code": 200,
  "message": "Deleted successfully",
  "data": []
}

A webhook can undergo a soft deletion process, during which its status is updated to ‘inactive.’ Upon restoration of the webhook, its status is changed to ‘active’ within the application.