Custom Front-End Integration
If you want to integration Fast Track notifications to your site without using our js library you can do that with custom integration. That requires more development time from your side, but it also gives you the absolute most possibilities to customize.
Prerequisites: To start with you will need your brand id and brand name. Brand id will always be an integer and your brand name will always be a lower case string. You can get these values from your Fast Track account manager.
You also have to make sure with your account manager that inbox and/or push notifications are enabled for your brand.
If you have read the other parts in the Fast Track integration documentation you might be familiar with the sid variable. It is basically an authentication token that can be exchanged in your operator API for a user id. You can read more about it here: Authentication.
To get started you need a couple of endpoints to different parts of Fast Track integration. You also need a pusher key. All this will be returned from this endpoint:
When you have a config object containing endpoints, a sid, a brand id and a brand name we can continue. Now you want to login to Fast Track using the sid. That will be done against endpoint
On success, the LoginAuthToken endpoint will return a user object which contains values for setting up pusher. Pusher will authenticate with an endpoint in Fast Tracks backend. When you are authenticated to pusher you can bind upon which events you want to listen to. Currently FT CRM supports three push notification "event types":
When you have bound the events to your functions populating the front end on messages you are done with the push notifications web socket part.
When using pusher on the client side you can either load pusher with a html script tag or via npm. Read more here about Pusher js. Pusher also has other libraries if you want to use pusher for your mobile app. Pusher docs
But there is more! What if the push notification was sent to the user when the user wasn't logged in? There is an endpoint for listing all existing messages a user has received:
Use the query parameters unread-only and inbox-only to filter your results.
The DisplayType can be used to send silent inbox notifications. There is a checkbox in the CRM for silent notifications.
By calling this URL on page load you can populate the front end with push notifications that were sent to the user while being logged out.
If you want to distinguish messages received / read by the user you can mark a notification as read using the following endpoint. When received the notifications from the endpoints above next time, the notification will be marked as read and you can take care of that in your JS / front end.
You can also mark a notification as deleted. That means that it will never be returned in any call anymore:
Let us know if you have any further questions