Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do I locate a Google SpreadSheet ID?

https://developers.google.com/apps-script/guides/rest/api#parameter_and_return_types

When using the Google Execution Api for Java, the ID of the spreadsheet isn't very easy to understand. Here is the code snippet:

// Initialize parameters for that function. String sheetId = "<ENTER_ID_OF_SPREADSHEET_TO_EXAMINE_HERE>"; List<Object> params = new ArrayList<Object>(); params.add(sheetId); 

Any Ideas on how to locate this. I run the Sheets api to return the id of a SpreadSheet but it returns a link, and when I use the https://spreadsheets.google.com/feeds/spreadsheets/STRING or just the STRING itself I still get: "code" : 404, "errors" : [ { "domain" : "global", "message" : "Requested entity was not found.", "reason" : "notFound"

like image 591
Boom3k Avatar asked Mar 17 '16 13:03

Boom3k


People also ask

How do I find the sheet ID in Excel?

The SHEET function returns the index number of a sheet in Excel. You can use the SHEET function to get a numeric index that represents the order of sheets in an Excel workbook, starting with 1 on the left and ending with N on the right, where N is the total number of sheets in the workbook.

How do I find the URL of a spreadsheet?

Click the Share button in the top right hand corner. In the Get link panel, set your spreadsheet file to be visible to 'Anyone with the link'. Click Copy link to copy your sharing link.


2 Answers

Found this deep inside the Apps Script API reference.

A spreadsheet ID can be extracted from its URL. For example, the spreadsheet ID in the URL https://docs.google.com/spreadsheets/d/abc1234567/edit#gid=0 is "abc1234567".

like image 151
Boom3k Avatar answered Sep 17 '22 15:09

Boom3k


https://developers.google.com/sheets/api/guides/concepts

states that:

Every API method requires a spreadsheetId parameter which is used to identify which spreadsheet is to be accessed or altered. This ID is the value between the "/d/" and the "/edit" in the URL of your spreadsheet. For example, consider the following URL that references a Google Sheets spreadsheet:

https://docs.google.com/spreadsheets/d/1qpyC0XzvTcKT6EISywvqESX3A0MwQoFDE8p-Bll4hps/edit#gid=0 

The ID of this spreadsheet is 1qpyC0XzvTcKT6EISywvqESX3A0MwQoFDE8p-Bll4hps.

So I just pulled up my spreadsheet and looked at the URL to find my ID.

Hope this helps!

like image 40
Sam Evers Avatar answered Sep 19 '22 15:09

Sam Evers