Trigger Transfers Overview

Data transfers in Endgrate are pretty simple, and consist of two steps.

  1. First, trigger the push or pull (POST api/push/transfer, POST api/pull/transfer). You'll receive a transfer_id in return. Triggering a transfer enqueues the transfer to be executed by Endgrate's task queue, which automatically handles details like rate limits, batching, authentication refreshes, and more.
  2. Once the transfer is completed, use the transfer_id to get the data (GET api/push/data, api/pull/data).

Asynchronous vs. Synchronous Transfers

By default, triggering transfers is an asynchronous process. This means that when triggering a transfer, Endgrate will return a transfer_id immediately, and the transfer is not guaranteed to be completed yet. As a result, you'll have to either poll the /data endpoints until the transfer is completed and data is available, or use webhooks to get the data.

To make transfers synchronous, set the synchronous flag when triggering the transfer. When this flag is on, Endgrate will only return a transfer_id once the transfer completes. In other words, the /transfer API call will hang until the transfer completes, at which point it will return the transfer_id to you. You can then use the transfer_id to immediately get the data from the /data endpoints.

We recommend using synchronous transfers only when dealing with relatively small amounts of data, because the Endgrate /transfer API call has a maximum response time of 5 minutes.


Session Configuration

Depending on your use case, after redirecting the user to the Endgrate UI, it might a good idea to obtain the session configuration information before triggering any transfers.

The GET api/session/configuration endpoint returns useful information to you such as the integration provider the end user selected, as well as passthrough field and passthrough schema information if applicable. You can also choose to get this information directly sent to you via the session configuration webhook.

📘

Note

It's totally fine to trigger transfers before sessions are configured by the end user! As long as you have a valid session_id, you can trigger transfers. The Endgrate task queue will only start executing the transfers once the end user finishes configuring the corresponding session.