We are getting questions from integrators about how to enumerate material a user has access to, so I thought I’d summarize the basics here.
First, a user can have access to several sites. Everyone has access to docs.getgrist.com, called the “personal site.” They may also belong to other sites. For example, I’m a member of gristlabs.getgrist.com, a private site for the team developing Grist. In our API, sites are called “orgs” and can be enumerated by fetching:
Once we’ve picked a site, the user will have access to documents and (in paid plans) workspaces. You can enumerate all the documents they have access to by fetching:
Once we’ve picked a document, the user will have access to several tables. You can enumerate the tables they have access to by fetching:
Here’s the result for an example document. The
tableId fields are particularly important, they are what you need to delve in to access data. Once you’ve picked a table (by
tableId), you can list its columns by fetching:
Finally, to get all the records from the table, just fetch:
See /records doc for details. We’ve actually already seen an example result, for the special
_grist_Tables table that … lists tables!
Ok, that’s a quick overview of the relevant endpoints, hope it is helpful!