Unsubscribe from an Event
delete
/restproxy/api/v2/channels/{channelId}/event-subscriptions
Unsubscribe from an event
Request
Supported Media Types
- application/json
Path Parameters
-
channelId: string
ID of the channel
Query Parameters
-
role: string
Name of Fabric enrollment to be used
-
subscription-id: string
ID of the subscription when operation succeeds
-
user-id: string
User name. It should be the same as the user defined in basic auth.
Response
Supported Media Types
- application/json
200 Response
Operation successful
Root Schema : schema
Type:
Show Source
object
-
error(optional):
string
-
result(optional):
array result
-
returnCode:
string
Allowed Values:
[ "Success", "Failure" ]
Nested Schema : UnEventSubscription
Type:
Show Source
object
-
errorMessage(optional):
string
-
status(optional):
string
-
subid:
string
ID of the subscription when operation succeeds
400 Response
Bad Request
Root Schema : Error
Type:
object
Error Information.
Show Source
-
errors(optional):
array errors
list of errors
-
message:
string
A human-readable error string.
-
status:
string
A short error status that defines the error, meant for programmatic parsing.
-
warnings(optional):
array warnings
list of warnings
401 Response
Unauthorized
Root Schema : Error
Type:
object
Error Information.
Show Source
-
errors(optional):
array errors
list of errors
-
message:
string
A human-readable error string.
-
status:
string
A short error status that defines the error, meant for programmatic parsing.
-
warnings(optional):
array warnings
list of warnings
403 Response
Forbidden
404 Response
Not Found
Root Schema : Error
Type:
object
Error Information.
Show Source
-
errors(optional):
array errors
list of errors
-
message:
string
A human-readable error string.
-
status:
string
A short error status that defines the error, meant for programmatic parsing.
-
warnings(optional):
array warnings
list of warnings
500 Response
Internal Server Error
Root Schema : Error
Type:
object
Error Information.
Show Source
-
errors(optional):
array errors
list of errors
-
message:
string
A human-readable error string.
-
status:
string
A short error status that defines the error, meant for programmatic parsing.
-
warnings(optional):
array warnings
list of warnings
Examples
This endpoint is used to unsubscribe from an event.
The following example shows how to unsubscribe from an event by submitting a DELETE request on the REST resource using cURL.
curl -v -u <username>:<password> -X DELETE \ '<restproxy of your blockchain instance>/api/v2/channels/default/event-subscriptions?role=<role>&user-id=<username>&subscription-id=<subscription ID>&channelId=<channel ID>'
For example,
curl -v -u obpuser:<password> -X DELETE \ 'https://myvm.oracle.com:10000/restproxy/api/v2/channels/default/event-subscriptions?role=myinstance_defaultuser&user-id=user1&subscription-id=testuser1-dc28b77c-7e58-4b09-ae23-b2c01fa01b70&channelId=default'
Note:
You can find the rest proxy 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": "user1-dc28b77c-7e58-4b09-ae23-b2c01fa01b70", "status": 200 } }