Create APIs to get data from Google Spread Sheet
To use your Google Spread Sheet as an Database must follow these instructions:
- Share your document with this email:
json-api@proto-rescuefy.iam.gserviceaccount.com
- First Row must be the key names
- The other rows are the values
- Sheet names is not allowed yet.
Base URL: https://get-sheet-data.vercel.app
- Request:
google-id
: Google Spread-Sheet ID.String
: Alphanumeric
GET - api/document/[google-id]
example: api/document/2ABtD2ndfB82XM0twWM3uomdsveMxykcEjBn7dQUFuBO
- Response:
object
:- keys:
String
, Sheet Names - values:
Array<object>
, Rows
- keys:
{
"Sheet0": [
{ "name": "Tony", "lastname": "Stark" },
{ "name": "Bruce", "lastname": "Wayne" }
],
"Sheet1": [
{ "name": "Natasha", "lastname": "Romanoff" },
{ "name": "Diana", "lastname": "Price" }
]
}
- Request:
google-id
: Google Spread-Sheet ID.String
: Alphanumericsheet-number
: Number of the Sheet (first is 0).Number
: Positive
GET - api/document/[google-id]/sheet/[sheet-number]
example: api/document/2ABtD2ndfB82XM0twWM3uomdsveMxykcEjBn7dQUFuBO/sheet/0
- Response:
object
:- values:
Array<object>
, Rows
- values:
[
{ "name": "Tony", "lastname": "Stark" },
{ "name": "Bruce", "lastname": "Wayne" }
]