SMS Notifications
PrivMX Bridge features WebSocket support. This allows you to receive instant notifications about changes, for example:
- new messages in Threads
- new files in Stores
- new items in Inboxes
A common use case is to send SMS notifications when a specific event occurs.
The following example shows how to build an SMS notification system using SMSAPI.
However, you can use any other notification service provider – just remove all the references to SMSAPI and reimplement the sendSms()
function.
Prerequisites
To send SMS notifications, you need to have an SMSAPI account. You also need a running PrivMX Bridge instance. Follow the getting started guide to set it up.
Subscribing to Notifications
- Connect to your PrivMX Bridge instance using WebSockets. See PrivMX Bridge docs for more information.
- Use the manager/subscribeToChannel method to subscribe to notification channel(s).
- Handle the incoming notifications and send SMS messages when needed. See SMSAPI docs for more information.
JavaScript example:
Unsubscribing from Notifications
When you no longer want to receive notifications, use the manager/unsubscribeFromChannel method to unsubscribe from the channel(s).
JavaScript example (uses request()
and config
from the previous example):
We use cookies on our website. We use them to ensure the proper functioning of the site and, if you agree, for purposes we set, such as analytics or marketing.
This is documentation for PrivMX v2.2, which is no longer actively maintained.