Skip to main content

Notifications API

Send a notification to a BlueShell user with the REST API: on their page, on their phone and, if needed, by e-mail. How to write the call and what the notify field does.

To send a notification you do not need a specific permission: it is enough that the technical user has a role. Roles are assigned as in How to create a role and a user; the technical user and the key are in Technical users and API keys: connecting an integration.

The endpoint for notifications is:

/rest/v1/notification

When you create a notification you can decide whether the user must be alerted or not.

Creating a new notification

POST /rest/v1/notification
{
  "title": "Titolo della notifica",
  "message": "Testo della notifica",
  "link_title": "Titolo del link",
  "link_href": "/index.php",
  "user_id": 1,
  "notify": 1
}

The required fields are:

  • title: the title of the notification

  • user_id: ID of the user to send the notification to; to notify several users make several POST calls one after the other

The message field, the text of the notification, is recommended.

If user_id is not the ID of a user of your marina the notification is not created.

If you wish, you can set these fields:

  • notify: it is 1 if you do not write it. The user sees the notification on their BlueShell page; if they have BlueShell open they see it right away, if they have a phone with the marina's apps they also get the notification on the phone, and if they were not reached in either way they receive an e-mail (if they chose to receive them). With 0 no alert is sent.

  • link_title: the text to put in the notification's clickable link

  • link_href: the URL (absolute or relative) where to send the user when they click the notification


Did this answer your question?