Suprema devices can display messages pre-registered in user configuration on the screen once a user authenticates on the device.
This feature can be achieved via BioStar 2 API starting in v2.9.8.
This article will guide you through setting private messages displayed on a device for each user.
There are two things you need to do to set a private message for a user to be displayed on a device.
1. Turn on the 'Server Private Message' option for the device on which you want the message to be displayed.
2. Set a Private Message for a user that will be displayed when the user authenticates on a device.
Part 1.
You must turn on the 'Server Private Message' option in the device setting for each device on which you want to display the message.
Note: Not all devices support 'Server Private Message' option. Please reach out to us for inquiries on it.
If the 'Server Private Message' option is turned on for the device, messages pre-registered in the user configuration will be displayed on the screen.
If the 'Server Private Message' option is turned off for the device, the function is set not to be used, and registered messages will not be shown.
You can change this option in the device information when you click on a device under the Device Tab in BioStar 2 Web UI.
As you can see above, you can change this option in BioStar 2 Web UI but you can also change it via API.
PUT /api/devices/:id
This API updates the device's configuration.
[PATH VARIABLE]
Id - Input the ID of the device that you want to update the configuration of.
[BODY PARAMETER]
Parameter | Type | Required | Description |
---|---|---|---|
display:server_private_message | Boolean | N | Server Private Message |
There are a lot more body parameters for this API that allows you to edit different device configurations. In this article, I've only written the relevant parameters for this topic.
If you want to learn more about this API and other body parameters, please check out the following link: https://bs2api.biostar2.com/#03c61115-19f8-4e6f-917c-f566fae51d4e
[POSTMAN REQUEST EXAMPLE]
After running the API, you should receive a 200 HTTPS code and a 0 response code like below.
This means you have successfully turned on the device's 'Server Private Message' option.
[POSTMAN RESPONSE EXAMPLE]
Part 2.
You need to set a Private Message for a user. This message will be displayed when the user authenticates on a device.
You can change this option in the user data when you click on the user under the User Tab in BioStar 2 Web UI.
As you can see above, you can change this option in BioStar 2 Web UI but you can also change it via API.
POST /users/phrase/:userId
This API creates or updates a user's private message, displayed on the device when the user authenticates.
Note: This API is available starting from v2.9.8.
[PATH VARIABLE]
userId - Input the ID of the user to which you want to set the private message.
[BODY PARAMETER]
Parameter | Type | Required | Description |
---|---|---|---|
phrase | String | Y | Phrase, which will be set as User Private Message. This has a 128-byte limit. Any phrase exceeding this will be truncated. |
[POSTMAN REQUEST EXAMPLE]
After running the API, you should receive a 200 HTTPS code and a 0 response code like below.
This means you have successfully set the private message for the user.
[POSTMAN RESPONSE EXAMPLE]
After finishing both steps, if the user authenticates on the device, they will see the private message "Hello Judy" on it!