The Simple API - Just call it

Log

A simple log database backed by Google Spreadsheet

1. You need a database

Go create your new spreadsheet, it will be your database. Get the sheetId.

sheetId

And then invite this email with Write permission. This is the bot that will write the log for you.

sheet-bot@thesimpleapi.iam.gserviceaccount.com
write permission

2. Send log

Request: (you can replace with your own params)
POST https://log.thesimpleapi.com/
1AqR2hceLxpr7zMMQtoWaZmZcHEOIS_Uu2jBSrT3ZS6o
:sheetId

Body:
{"id":1,"action":"register","email":"trungdq88@gmail.com"}
Body


Response:
(Press "Send" to see response)

View example shpreadsheet

Requirements

  • Request body must be a JSON object or an array of JSON object (bulk insert).
  • Supported data types are string, number and boolean. Any other unregonized data types will be converted to JSON string representation of the value.
  • Column [[createdAt]] is automatically added with ISO string date time of the record.

3. Multi pages

You can select the page (or "sheet", or "table"... you may call it) by append the page name in endpoint: /:sheetId/:page

Request: (you can replace with your own params)
POST https://log.thesimpleapi.com/
1AqR2hceLxpr7zMMQtoWaZmZcHEOIS_Uu2jBSrT3ZS6o
:sheetId
/
Users
:page

Body:
{"id":1,"action":"register","email":"trungdq88@gmail.com"}
Body


Response:
(Press "Send" to see response)

4. View/manage logs

You can view, filter, create visualizations... on your Google Spreadsheet. This is the example shpreadsheet used in the previous step.

5. What can you do with this?

  • Quickly collect and aggregate data.
  • For example, I logged browser information of all requests to this page to this shpreadsheet

6. Licences

Free for all of your hobby projects. Contact me if you need more.