Skip to content

Translator of REST requests to build RESTful API using Google Apps Script

Notifications You must be signed in to change notification settings

dan1901/gas-rest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gas-rest

Translator of REST requests to build RESTful API using Google Apps Script hosted on http://rest.daspot.ru

Example app on Ember.js

Example app on AngularJS

Why

To build RESTful backend for frontend development for 5 minutes

Overview

Route Verb Description
/api/:script_id Get Get all items from getSheets()[0]
/api/:script_id Post Create item on getSheets()[0]
/api/:script_id/:sheet_name Get Get all items from getSheetByName(:sheet_name)
/api/:script_id/:sheet_name Post Create item on getSheetByName(:sheet_name)
/api/:script_id/:sheet_name/:item_id Get Get single item from getSheetByName(:sheet_name)
/api/:script_id/:sheet_name/:item_id Post/Put Update item on getSheetByName(:sheet_name)
/api/:script_id/:sheet_name/:item_id Delete Delete item on getSheetByName(:sheet_name)

Profit

For example we have collection of cats:

ScreenShot

And we have a script like this one, which has been deployed as a web app with ID AKfycbwEw9l-DeT3Qfv5CmRm60k0RALu2iVIyvyAuaWZbHp2we7xi1E

Now we can:

  • get all cats:

ScreenShot

  • create new cat:

ScreenShot

ScreenShot

  • update a cat:

ScreenShot

ScreenShot

  • get cat by id:

ScreenShot

  • delete a cat:

ScreenShot

ScreenShot

How to

ScreenShot

ScreenShot

  • open script editor

ScreenShot

  • paste your tables ID

ScreenShot

  • run function doGet once to authorize script

ScreenShot

ScreenShot

ScreenShot

  • disregard the error message

ScreenShot

  • save new version of script

ScreenShot

ScreenShot

  • deploy script as web app

ScreenShot

ScreenShot

ScreenShot

Now you can build app which is consuming data via RESTful API

About

Translator of REST requests to build RESTful API using Google Apps Script

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published