Archived Forum Post

Index of archived forum posts

Question:

Google Sheets API

Oct 04 '17 at 10:23

Hi, Is there currently or in development the capability to use and access the google sheets API for xojo? I would like to be able to download and upload values to cells within a specific google sheet. As I understand it the CHilkat xojo plugin would give me the capability of getting access to google API docs but I don't see any provided method for editing google sheets within xojo. If this is correct I see my next best alternative to use the plugin to access google drive and import data from a google sheet or text file in google drive, modify it and then upload back to google drive. Thank you in advance for any advice you can give. regards, Matt


Answer

I think the answer is that the Google Sheets API is just another REST API like anything else.

In that sense, it's an API with various calls using POST, GET, PUT, DELETE, etc. where information is passed in one or more of the following:

  1. JSON request body
  2. Query params
  3. Request header fields

The HTTP response is a response status code with a JSON response body.

The task of writing code for any REST API is simply to form the correct HTTP request, which involves building the JSON for the request body, and to parse the JSON contained in the response body.

Chilkat is working on an online tool (which is in Beta now, but not yet widely announced) to do the following:

  1. Copy-and-paste sample JSON to generate code that creates the JSON, and..
  2. Copy-and-paste sample JSON to generate code that parses the JSON.

You can try it here: http://tools.chilkat.io/