View Subscriptions List

View Subscriptions List

View all Subscriptions 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/subscriptions

Example Request

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

Kindly replace the token with your respective access_token.

Example Response

{
  "status": "OK",
  "code": 200,
  "message": "Subscriptions List",
  "data": [
    {
      "id": 2,
      "event": "vmn:message:in",
      "identity": "keyword:1",
      "payload": null,
      "webhook_id": "flow:1",
      "created_at": "2022-12-06T12:43:51.000000Z"
    },
    {
      "id": 1,
      "event": "vmn:message:in",
      "identity": "number:1",
      "payload": null,
      "webhook_id": "flow:2",
      "created_at": "2022-12-06T12:39:10.000000Z"
    }
  ],
  "links": {
    "first": "{endpoint}developer/subscriptions?page=1",
    "last": "{endpoint}developer/subscriptions?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/subscriptions?page=1",
        "label": "1",
        "active": true
      },
      {
        "url": null,
        "label": "Next »",
        "active": false
      }
    ],
    "path": "{endpoint}developer/subscriptions",
    "per_page": 15,
    "to": 2,
    "total": 2
  }
}

Create a Subscription 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.

Before creating subscription, please make sure you have already created Webhook, refer to Create Webhook

POST

{endpoint}developer/subscriptions

PARAMETERS

Name optional Descriptions
event No Type of the event you subscribe to. [All events]
identity No How should identity the event source.
webhook_id No Your Webhook Id created earlier.

Example Request

cURL - cURL
curl --location --globoff '{endpoint}api/v2/developer/subscriptions' \
--data '{
        "event": "vmn:message:in",
        "identity" : "all",
        "webhook_id" : "{webhook_Id}"
}'

Example Response

{
  "status": "OK",
  "code": 200,
  "message": "Subscription Saved Successfully",
  "data": {
    "id": 3,
    "event": "vmn:message:in",
    "identity": "all",
    "payload": [],
    "webhook_id": "dd4b91af-167d-48e6-901d-ae181ff6e80d",
    "created_at": "2022-12-07T06:20:09.000000Z"
  }
}

To show a Subscription 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/subscriptions/: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/subscriptions/{Subscription_id}'

Example Response

{
  "status": "OK",
  "code": 200,
  "message": "Subscription",
  "data": {
    "id": 2,
    "event": "vmn:message:in",
    "identity": "keyword:1",
    "payload": null,
    "webhook_id": "flow:1",
    "created_at": "2022-12-06T12:43:51.000000Z"
  }
}
{endpoint}developer/subscriptions/: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/subscriptions/{Subscription_id}'

Example Response

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

Create a Subscription 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.

POST

{endpoint}developer/subscriptions

PARAMETERS

Name optional Descriptions
event No Type of the event you subscribe to. [All events]
identity No How should identity the event source.
webhook_id No Your Webhook Id created earlier.

Example Request

cURL - cURL
curl --location --globoff '{endpoint}api/v2/developer/subscriptions' \
--data '{
        "event": "sms:message:status",
        "identity" : "all",
        "webhook_id" : "180ebbb5-9b6f-4c51-a98a-**********"
}'

Example Response

{
  "status": "OK",
  "code": 200,
  "message": "Subscription Saved Successfully",
  "data": {
    "id": 3,
    "event": "sms:message:status",
    "identity": "all",
    "payload": [],
    "webhook_id": "dd4b91af-167d-48e6-901d-ae181ff6e80d",
    "created_at": "2022-12-07T06:20:09.000000Z"
  }
}