Last updated:
0 purchases
grist api
Features #
Grist API implementation for flutter
Usage #
Create API Object #
You can get docs_id and api_key settings
Server key is your URL, docs.getgrist.com if you're not using team.
And teamname.getgrist.com if you are in team.
final gristApi = GristAPI('docs_id' , 'api_key', server: 'https://docs.getgrist.com');
copied to clipboard
Fetch data from table #
Note: Name is one of the sample field that we are using.
final ret = await gristApi.fetchRecords('TableName');
for (var v in ret) {
print(v['fields']['Name']);
}
copied to clipboard
With limit
Example for just retreive 5 rows
final ret = await gristApi.fetchRecords('TableName', limit=5);
copied to clipboard
With sort
Sort with multiple fields, example Name ascending and age descending
final ret = await gristApi.fetchRecords('TableName', sort='Name,-age');
copied to clipboard
With filter
Example, filter only name Vero or Pascal
final ret = await gristApi.fetchRecords('TableName', filter={Name: ['Vero','Pascal']});
copied to clipboard
Add data #
Return value will contains new id that created.
final ret = await gristApi.addRecords('TableName', [{"Name": "This is a new name"}]);
copied to clipboard
Update data #
Update records, be sure to include 'id' fields on the data that being updated.
final ret = await gristApi.updateRecords('TableName', [{"id": 19, "Name": "Update name to this"}]);
copied to clipboard
Delete data #
Delete data, parameter is just list of ids that wants to be deleted.
final ret = await gristApi.deleteRecords('TableName', [18]);
copied to clipboard
Additional information #
GRIST API : https://support.getgrist.com/rest-api/
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.