grist-core
grist-core copied to clipboard
Stream endpoints
There are many applications where we need to direct access data from Grist without using the REST API.
I propose to consider adding such a concept as Stream endpoints
Generate a unique link for the current user http://grist.app/[team]/[workspace]/[doc]/[table]/[user_UUID_hash]/format=csv
For direct write or read data from tables.
What do you think about this?
Hi @Vladimir-Va, are you asking for an endpoint that can accept data in csv format? Your link appears to be to a section about some 256 character limit in Excel?
What kind of authentication method are you interested in? From the [user_UUID_hash] in your example it sounds like you might want something like public link-sharing, where the endpoint is publicly accessible but has a hard-to-guess code in it?
Hello @paulfitz, thank you.
Client API: How to Integrate with Excel
I am looking for a way to synchronize remote database and data on PC.
For example one of the services offers an application to synchronize data on a local PC Pyrus Sync.
But I found the approach offered by RavenDB worthy of attention.
Indeed, if you think about it, then in the proposed version http://grist.app/[team]/[workspace]/[doc]/[table]/[user_UUID_hash]/format=csv there is a flaw.
Better is http://grist.app/[stream_UUID]/format/csv
It looks like public link-sharing, but to send a unique link with an individual setting of access rights for the recipient of the link and the ability for the recipient to select the format as .sqlite/.xls/.cvs/.grist (format what we have API /docs/{docId}/download).
For example: I need to pass a permalink with data for a user without an API key with the columns he needs, the rows filtered and sorted for this link. To do this, I go to Access Rules. I create a block with a generated new link with [stream_UUID]. In this block, I set [stream_SLUG] (any text for filename), set life time for link, select the document, table, columns and data for filtering and sorting rows with SetAsID/Read/Update/Write access.
- Recipient permalink is Grist user:
- If format/grist add like as Add new/Import from file but Add new/Stream endpoint;
- Upload data to Grist App and if he has access for Update (can update cells, can't modify format) / Write (can use formulas in cells);
- The stream creator gets Updated / Writed data. Typical use: Request data on the price of goods from several suppliers for comparison and selection of a supplier. I not an expert and think you need simplify and not use access rules bcs need use sockets for data exchange if use Read / Update / Write access in this concept. But then the UNION and UNION ALL operator from SQL will be severely lacking to combine data from permalinks streamed suppliers (UNION it is already lacking).
- A user who knows nothing about Grist:
- Download .sqlite/.xls/.cvs or connects to Stream endpoint as in tutorial Client API: How to Integrate with Excel, the main thing is there is no need to go to grist and explain what you need to click to download, the user always has a permalink with the data at the time of using the link.
- Performs work and sends the file back. Or use this live data for report generation. Or add to print lable software. etc.
- Permalink Creator: 4.1. Can collect data into one file from several files received from different suppliers. 4.2. Add new/Import from file Grist App check filename, if filename=[stream_UUID] or [stream_SLUG], read column name and if column accees= SetAsID (Read this ID for data matching) / Read (Skip column) / Update (Rewrite column) / Write (Rewrite column)
Hypothetically, this would help when exchanging data in tables between Grist documents of the user himself (periodically there are questions on the forum).