Monitor WebSocket API Events with Postman
This topic provides an example of capturing call events to demonstrate how to monitor API events of Cloud One BCS Software Edition with Postman.
Prerequisites
- You have downloaded and installed Postman desktop app.
Note: If you want to monitor extension status or trunk status, make sure that the corresponding monitor settings in the Advanced Settings are enabled.

- You have got an access token.
Procedure
- Sign in to Postman.
At the side-bar, click New > WebSocket to open a new request tab.

Establish a WebSocket connection with Cloud One BCS Software Edition API.

In the request field, compose the WebSocket connection request.
In this example, compose the following request:
wss://192.168.5.150:8088/openapi/v1.0/subscribe?access_token=ah1i5B5uGYBY4W4ITiOV9lBwrDp2KPyQ
Click Connect.
The Response field returns "Connected", indicating that the WebSocket connection is successfully established.

Subscribe to the desired events.

Query the desired event ID in API Event Summary, and compose the event subscription message in the Message tab.
In this example, subscribe to the events (30011) Call Status Changed and (30012) New CDR.
{"topic_list":[30011,30012]}Click Send.
The Response field returns "SUCCESS", indicating that the event subscription is successful.

Send a heartbeat request at regular intervals to keep the connection alive.
Note: If there is no interaction between the Postman and PBX for 60 seconds, the WebSocket connection will be automatically disconnected.

- In the Message tab, enter heartbeat.
Click Send.
The Response field returns a heartbeat response, indicating that the request is successful.

Result
When a subscribed event occurs, the system automatically sends the event report.
In this example, when the monitored extension receives, answers and ends a call, the system automatically sends the event report of "(30011) Call Status Changed" and "(30012) New CDR".
