Hey all, trying to figure out an efficient way to export pages to import into an AI based index on a continuous basis. We are using the Pages api to export docs but want to do it on a pretty regular basis. Is there any way to search for pages based on last updated date? We are looking for a way to do a full export of a bunch of pages but then do partial exports of any changes every hour. This is for a big shared customer between us.
Hi @Vlad_Shlosberg - Welcome to the Coda community! Just to make sure we have the terminology straight:
- A Coda workspace contains many docs.
- A doc contains many pages.
- A page contains the content.
Currently the Coda API can be used to list docs, list the pages of those docs, and export a page to HTML or markdown.
Although you can’t filter on updated date, both the Document and Page resource contain a updatedAt
field you can use to determine if it has been updated recently. So your approach could be:
- For each doc:
- If updated after last sync:
- For each page in the doc:
- If updated after last sync:
- Export page content
- If updated after last sync:
- For each page in the doc:
- If updated after last sync:
One tricky bit is that I think table content updates will cause the document to be updated, but not any individual page. If the content you want to index lives in a table you may need to update every page in the doc, or at least every page that contains a table.
1 Like