First of all you need to Download cDataSet.xlsm and go to the scriptDBCom module, where you’ll find various examples.

Readonly, no oAuth2.

To get used to the API we’ll first of all use some of my test data in a read-only ScriptDB mode, as well as my Rest Handler. Later on, you’ll create your own.

Get authenticated

We won’t need to bother with oAuth2 for this since the handler we’ll use is set up for public access, but we will need to register this app (read-only access to my restHandler)  on your PC. This is a one-off exercise, for which you’ll need to run this code.
What just happened is that you’ve created an encrypted entry in your registry, called “getStarted”. In future when you need to access this from any workbook you can simply refer to it by its name. We’ll deal with the meaning of the parameters later, but the URL refers to the Google Apps Script handler that will handle all requests associated with this registry entry, as described in Handler for cScriptDbCom requests

Data in the scriptDBPrimer library

The data in the scriptDBprimer library has been copied from two sheets in the cDataSet workbook – VBAParseData and VBAParseCustomers. This is the same data used in – nosql database for VBA and – noSQL database for GAS

Do some counts

This will show how many objects are of the VBAParseData class in the scriptDBPrimer library
And in the VBAParseCustomers library
How many customers in the United States

Do some queries

Get data for customers in the USA
Get data for a particular customer

Get data by unique ID

Deal with a Date


Check that this is really read-only access

Try to delete some records, and you won’t be allowed to.
Since I have only granted read-only access in my handler to this app/URL combination, then deletion should fail like this.
See more on this at An API for scriptDB, and very closely related APIS at – nosql database for VBA and – noSQL database for GAS
For help and more information join our forum, follow the blog or follow me on Twitter