title | topic | type |
---|---|---|
Listen for events |
events |
how-to |
The event API allows you to subscribe to a variety of different events generated by Working Group Two's systems.
The examples will start a subscription to voice and voicemail events, which includes call initiated, call ended and new voicemail received.
Event type | Required right |
---|---|
VOICE_EVENT | events.voice.subscribe |
VOICEMAIL_EVENT | events.voicemail.subscribe |
LOCATION_UPDATE_EVENT | events.location.subscribe |
ROAMING_EVENT | events.roaming.subscribe |
TOKEN_AUDIT_EVENT | events.audit.token.subscribe |
Your rights can be configured in Console
Setup streaming of events, without manual acknowledgment:
grpcurl \
-H "Authorization: Basic ${OPERATOR_TOKEN}"\
-import-path . \
-proto wgtwo/events/v0/events.proto \
-d '
{
"type": ["VOICE_EVENT"]
}
' \
api.wgtwo.com:443 \
wgtwo.events.v0.EventsService.Subscribe
Then you can add event-grpc
and utils-grpc
:
In the below example we enable manual acknowledgement, and setting a custom ack timeout.
Include Google's Protocol Buffers utility library for support of Google's Well-Known Types: