This article describes the two-way synchronisation of program items/favourites
The Conference Compass platform supports two-way synchronisation of programme items/favourites between an external source and its backend services. This article describes the requirements for this development. Reach out to your Customer Success Manager, if you are interested to have this custom development for your app.
Programme/Favourite Sync requirements
The Conference Compass platform supports two-way synchronisation of programme items/favourites between an external source and its backend services. The data can later be accessed on one or more devices after a user has signed in.
The synchronisation is based on the fact that a user has successfully signed in and the 3rd party supplier has returned a valid user token that can be used during the synchronisation process.
A program item that is synchronised needs to contain: a unique identifier, an action description (either ADD or DELETE), an action date (the date it was last modified at its source) and the user token that is used to relate the favourite to a specific user.
Note: timestamps should be in GMT.
Synchronisation calls
For the two-way synchronisation there are two API endpoints used.
The first one is an authenticated GET request with the following format:
method: GET,
host: https://eauserver.com
path: /getUserFavorites,
headers: Authorization: 'Bearer '+ token_obtained_from_user (if we use a bearer authentication OAuth otherwise some user identification mechanism)
[{
"item" : "session_21982",
"actionDate" : "2017-05-02T10:45:12.798Z",
"action" : "ADD"
}, {
"item" : "session_114582",
"actionDate" : "2017-05-03T12:15:00.128Z",
"action" : "DELETE"
}]
The Conference Compass backend will check the action and action date when it processes incoming favorites. This means that it will compare objects based on the actionDate property and if an incoming item has a newer data it will replace the client item action (ADD or DELETE).
The second API endpoint updates the client API through a POST request that has the following format:
method: POST,
host: https://eauserver.com
path: /postUserFavorites,
headers: Authorization: 'Bearer '+ token_obtained_from_user (if we use a bearer authentication OAuth2 otherwise some user identification mechanism)
[{
"item" : "session_21982",
"actionDate" : "2017-05-02T10:45:12.798Z",
"action" : "DELETE"
}, {
"item" : "session_114582",
"actionDate" : "2017-05-03T12:15:00.128Z",
"action" : "ADD"
}]
The second method updates the client API by writing to it through a POST request. If a read-only synchronisation is required, it is enough to only implement the first GET method.