Best Practices
Managing a User’s Connected Status
It is important to mark users in your system as connected to Validic for as long as they have at least one authorized “consumer” through Validic. Because of this, your user table should include some kind of “connected_to_validic” flag that is set to true once you receive that user’s first sync notification and false once you receive that user’s last disconnect notification. This is evident in the connected_third_parties
array present on both sync and disconnect notifications.
For example, if you receive a sync notification and that array only contains one “consumer” name, then that represents a user’s first sync notification and their “connected_to_validic” flag should be set to true. Conversely, if you receive a disconnect notification and that array contains zero “consumer” names, then that represents the user’s last disconnect notification and that flag should be set to false.
Sending Historical Data on Initial Sync
A best practice for handling historical data (typically covering the last 6 months) is to POST to Validic upon receiving a user’s first Sync Notification.
A Typical Workflow for Posting Historical Data
- Receive sync notification
- Determine if it’s an initial sync
- If initial, query for users historical data
- Loop through each record and POST to Validic Connect
If a user authorizes access to their data by an additional “consumer”, you do not need to send historical data again. Subsequent authorizations will also receive historic data on initial sync.
Sending Newly Created Data
As soon as you receive new data from Validic Connect, it’s a best practice to push it to Validic Connect. This will provide a better experience with more real-time data with both end users and the applications they are connecting.
After the record has been saved in your database, we suggest sending newly created data via a database callback that submits a POST request to Validic Connect. This can be accompanied by periodic reconciliation.
Periodic Data Reconciliation
Validic Connect partners should periodically reconcile the data in their database with what is in the Validic database. To do so, use the Validic latest (https://validic.com/contentblock/latest) endpoint to regularly query your users data. Your system should look for discrepancies using each activity’s Validic _id stored from the initial POST request to Validic, and reconcile any missing or duplicate data in Validic using a POST or DELETE. A regular reconciliation of comparing what is in Validic with what is in your database will ensure end users see the same data in authorized “consumer” applications as they do in your application.
Deleting Users
As users get deleted in your system you should delete them in Validic as well. To do so, just pass in the original UID for that user:
https://api.validic.com/v1/organizations/5176906c6deddac02c000001/users.json -H 'Content-Type': 'application/json' { "access_token": "ORGANIZATION_ACCESS_TOKEN", "uid": "YOUR_USER_ID" }