Synchronise Customers data

Here we take the example of a bi-directional synchronisation between ClicRDV and a business software or another database called DB herebelow.

The synchronisation requires that each of the softwares can keep a reference to the identifier used on the other Information System (clicrdvId for example), and a timestamp of the last modification (updated_at on ClicRDV). The ClicRDV API proposes a field externId, free to use, which allows you to store the identifier of a fiche on an external system.

Synchronisation process

Synchronisation DB -> ClicRDV :

  • Retrieve the whole set of DB fiches modified since the last transmission
  • If the fiche already has a clicrdvId, modify the fiche on ClicRDV
  • Otherwise, create the fiches on ClicRDV by sending the DB identifier in the field externId, then store the ClicRDV identifier created in clicrdvId

Synchronisation ClicRDV -> DB :

  • Retrieve the whole set of ClicRDV fiches modified since the last transmission
  • If the fiche already has a externId, modify the fiche in the DB
  • Otherwise, insert the fiches in the DB, then store the generated identifier in the externId of the ClicRDV fiches.
  • Store the timestamp of the last transmission for the next execution.

This process can then be executed at regular intervals (for example by a cron), usually once a day.

Restrictions

The ClicRDV externId field must be an integer. If your identifiers are not integers, you can use a custom field instead.