List Event Subscriptions



List all event subscriptions.


Supported Media Types
Path Parameters
Query Parameters
Back to Top


Supported Media Types

200 Response

Successful operation
Body ()
Root Schema : schema
Type: object
Show Source
Nested Schema : result
Type: array
Show Source
Nested Schema : EventSubscription
Type: object
Show Source
Nested Schema : callbackTLSCerts
Type: object
Show Source

400 Response

Bad Request

401 Response

Not authorized

403 Response


404 Response

Invalid parameters

500 Response

Service unavailable
Back to Top


This endpoint is used to generate a list of all the events subscribed by a Blockchain user in the specified channel.

The following example shows how to get the list of event subscriptions by submitting a GET request on the REST resource using cURL.

curl -v -u <username>:<password> -X GET \
  "<restproxy of your Blockchain instance>/api/v2/channels/<channelName>/event-subscriptions?role=<role>&user-id=<username>&subscription-id=<subscription ID>&channelName=<channel_name>"

For example,

curl -v -u obpuser:<password> -X GET \


You can find the restproxy value of your Blockchain instance from the Nodes tab of your instance console.

Example of the Response Body

The following example shows the contents of the response body in JSON format:

   "returnCode": "Success",
   "error": "",
   "result": {
       "subid": "obpuser-b75db132-605a-41a1-86d2-d5be9237c826",
       "type": "chaincode",
       "callbackURL": "",
       "callbackTLSCerts": {},
       "expires": "1m",
       "expireTime": "2021-08-20T04:33:53+0000",
       "txid": "b1c11242383212cfdcca97d68efc0b3641436b1845a9b4c6e822cf6099ca49ee",
       "chaincode": "obcs-example02",
       "event": ".*",
       "seek": "newest",
       "block": 0
  • subid is the subscription ID.
  • type specifies the event type. In this example, chaincode indicates that the events emitted from a chaincode will be returned.
  • callbackURL specifies the event callback address which is a valid HTTP/HTTPS address.
  • expires indicates that this subscription expires after 1 month since the time of current request.
  • txid is the transaction ID.
  • chaincode is the chaincode ID of the chaincode application subscribed to.
  • event is the chaincode event filter. * indicates that the user subscribed to all the events in the specified chaincode.
  • seek specifies which blocks to be delivered. In this example, newest indicates that this subscription delivers the newest block.
  • block indicates the block number.
Back to Top