I use the following code to add a list line , this is successful. But he looks complicated.
SpreadsheetService service =
new SpreadsheetService("MySpreadsheetIntegration-v1");
URL SPREADSHEET_FEED_URL = new URL(
"https://spreadsheets.google.com/feeds/spreadsheets/private/full");
SpreadsheetFeed feed = service.getFeed(SPREADSHEET_FEED_URL,
SpreadsheetFeed.class);
List<SpreadsheetEntry> spreadsheets = feed.getEntries();
if (spreadsheets.size() == 0) {
}
SpreadsheetEntry spreadsheet = spreadsheets.get(0);
System.out.println(spreadsheet.getTitle().getPlainText());
WorksheetFeed worksheetFeed = service.getFeed(
spreadsheet.getWorksheetFeedUrl(), WorksheetFeed.class);
List<WorksheetEntry> worksheets = worksheetFeed.getEntries();
WorksheetEntry worksheet = worksheets.get(0);
URL listFeedUrl = worksheet.getListFeedUrl();
ListFeed listFeed = service.getFeed(listFeedUrl, ListFeed.class);
ListEntry row = new ListEntry();
row.getCustomElements().setValueLocal("firstname", "Joe");
row.getCustomElements().setValueLocal("lastname", "Smith");
row = service.insert(listFeedUrl, row);
And now I want to be simple.
Instead of requesting all distribution sheets, I want to request only my distribution sheet, which I saved on Google Drive.
I have a link to a file distribution sheet, docs.google.com/spreadsheet/ccc?key= KEYOFFILE # gid = 0.
Please say Thank you
source
share