A
A
Alexander Andreev2017-03-14 13:55:37
PHP
Alexander Andreev, 2017-03-14 13:55:37

How to get the contents of a sheet/tab of a table on google docs?

I'm trying to get a table from google docs using this client https://github.com/google/google-api-php-client accessed the table like this:

$url = 'https://sheets.googleapis.com/v4/spreadsheets/' . $docId . '/?key=KEY';
  $method = 'GET';
  $headers = ["Authorization" => "Bearer $accessToken", "GData-Version" => "3.0"];
  $httpClient = new GuzzleHttp\Client(['headers' => $headers]);
  $resp = $httpClient->request($method, $url);
  $body = $resp->getBody()->getContents();
  $value = json_decode($body, true);

At the output I get this thing:
joxi.ru/DmBXGOZhwxlYXA document tab options (source document) joxi.ru/Y2LjWJQS9LzoJr . I don’t understand how I can further pull out the contents of specific sheets of the document knowing their id joxi.ru/KAgKz4Bc46DxwA . The documentation is all in English, I can’t figure it out for the third hour.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question