How much of the delay is between the data displayed on the Coda website and the data retrieved via the API

I’ve been using Integromat to retrieve Coda data via API and found that the retrieved data is out of date (delay occurs).
which caused me to repeatedly fetch the data. until the data is updated

I would like to know how much of the approximate delay is between the data displayed on the Coda website and the data retrieved via the API.

1 Like

Hey Aunnop, thanks for reaching out! This is a question for the Developer Central section of the community. I hope you don’t mind if I go ahead and move this post over considering.

In the meantime, it sounds like you need our Get mutation status endpoint: Coda API (v1) Reference Documentation.

When you make updates to Coda via the API, those changes do not take effect in your doc immediately. The way that I understand it is that your request is added to a list of requests that are processed in the order we receive them, so there’s no constant time for the changes to complete as that time varies depending on requests ahead of it and your own doc’s performance. You can use the Get mutation status endpoint to track when the changes are complete.

Hi @Aunnop_Jusungnoen - From when a change is made in your browser to when it’s reflected in the API is usually a few seconds, but it can vary and we don’t make any guarantees.

We recently added a new header, X-Coda-Doc-Version: latest, to help with this. When included with an API request, it will cause the request to fail if there are pending operations that haven’t been fully merged. You can read more about it here:

3 Likes

This is very cool!! I think this header will be my default method of dealing with this going forward.

Question @Eric_Koleda - the way I read these docs, if you supply that header, it will return an error if there is a pending update anywhere in the doc, right? Or just when that update is somewhere in the dependency graph for the row (for example) that we’re requesting?

hello :slight_smile:
i have a related questiom, in cross doc (that from what i’ve got uses apis), from when i change value in a table in doc A, if i go in doc B where the table is cross-docked, i have to sync 5/8 times to actually get the new rows or modified ones (or probably wait 2 minutes and a single sync is fine)

is there a way to implement what you’re talking about in cross doc sync?
then, extra question, is it a problem if i press the ‘sync’ like a lot of times? do i get banned? :sweat_smile:

thanks :slight_smile:

That’s correct. It is looking at any pending updates to the doc, from any source.

I’m not sure. To be clear, this new feature doesn’t get you new content any faster, it just fails rather than return the old content. With Cross-doc there may be other issues at play as well.

No, the Cross-doc police won’t come get you :slight_smile:

1 Like

Thanks for the answer @Eric_Koleda :slight_smile:

If i knew this variable i could disable a button that i use to “sync” all the tables with refresh tables, and i was worried for the numbers of request because i will allow many users in a single doc to press it freely to update their receipt from stripe, that will allow them to enter with an autogenerated code, so i’m thinking about impatient users :slight_smile: