API Documentation

Getting Started

Welcome to the Cellmate API Documentation. Here, you'll find a request-response style guide for connecting to the API and interacting with your data housed in a Google Sheet.

This API follows the conventions of REST, with a twist. Each of your services is in itself a REST API. Here's a list of terms that might come up:

Google Terms Cellmate Terms
A Google Sheet A Service
Worksheets (tabs) Endpoints or Sheets
Rows Rows

Worksheets

List All Worksheets

GET /api/<service-id> 
Request
$.getJSON("https://cellmateapp.com/api/<service-id>", function(results){
  results.forEach(function(result){
    console.log(result.title)
  })
})
curl https://cellmateapp.com/api/<service-id>
Response
[
  {
    "title":"employees",
    "id":0,
    "url":"https://cellmateapp.com/api/<service-id>/employees"
   }
]

Retrieve One Worksheet

GET /api/<service-id>/<sheet-name> 
Request
curl https://cellmateapp.com/api/<service-id>/<sheet-name>
$.getJSON("https://cellmateapp.com/api/<service-id>/<sheet-name>", function(results){
  results.forEach(function(result){
    console.log(result.name)
  })
})
Response

[
  {
    "name": "Jesse Shawl",
    "position": "CEO",
    "email": "jesse@cellmateapp.com"
  },
  {
    "name": "Joe Schmoe",
    "position": "CFO",
    "email": "joes@example.com"
  },
  {
    "name": "Jane Schmane",
    "position": "COO",
    "email": "janes@example.com"
  }
]

Rows

List All Rows in a Worksheet

Getting a list of all the rows in a worksheet is the same thing as retrieving one worksheet. So, scroll up a little and follow the previous request/reponse example.

Retrieve One Row in a Worksheet

When retrieving values from a large worksheet, you can speed up the response time by only requesting what you need.

Note: The Row number matches the row number in the google sheet.

GET /api/<service-id>/<sheet-name>/
Request
$.getJSON("https://cellmateapp.com/api/<service-id>/<sheet-name>/<row-number>", function(result){
  console.log(result.title)
})
curl https://cellmateapp.com/api/<service-id>/<sheet-name>/<row-number>
Response
{
  "name": "Jesse Shawl",
  "position": "CEO",
  "email": "jesse@cellmateapp.com"
}