Currently, the maesn unified API does not support webhooks. Thus, we recommend that you keep the data your retrieve from the maesn API up-to-date through regular polling.

1

Save your customer's Account Key

Get the account key from the connection process for an embedded maesn Connect link. Learn more in our maesn Connect guide.

To authenticate your API requests to maesn, save your end users’ account key in your backend. The account key will be required to poll for data in the steps below.

2

Synchronize data easliy & efficiently

Ensure that you store the timestamp of when you last fetched data from maesn as ‘lastModified’. Use this timestamp in subsequent API requests to get only the data that was updated since your last GET call. For example, you can request lastModified=2021-03-30T20:44:18, and only fetch objects that are new or changed.

Example code snippet
    const response = await axios.get(url, {
        params: {
            "lastModified": lastModified
        },
        headers: {
            'X-API-KEY': apiKey,
            'X-ACCOUNT-KEY': accountKey
        }
    });
3

Poll with the lowest viable frequency

Determining the optimal polling frequency is a trade-off between how fresh the data you operate on needs to be and the network traffic volume (and the associated costs) incurred.

As an example, it would be wasteful to poll for updates every minute, if the data we are polling for is only updated once a day. On the other hand, presenting the user with stale date may degrade the user experience or even lead to errors.

Thus, it is important to choose a polling-frequency that is high enough to provide the best possible user experience, but at the same time doesn’t incur unnecessary cost. In addition, consider the rate-limits of the maesn API and the 3rd party systems.