Skip to content

Instantly share code, notes, and snippets.

@ruseel
Last active March 16, 2018 07:43
Show Gist options
  • Save ruseel/7ef9e82540781438282aaa353eea45bb to your computer and use it in GitHub Desktop.
Save ruseel/7ef9e82540781438282aaa353eea45bb to your computer and use it in GitHub Desktop.
spreadsheet.values.append java example
// credential from ServiceAccount json file
GoogleCredential credential = GoogleCredential.fromStream(new FileInputStream(p))
.createScoped(Collections.singleton(SheetsScopes.SPREADSHEETS));
Sheets service = new Sheets.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential)
.setApplicationName(APPLICATION_NAME)
.build();
AppendValuesResponse r = service.spreadsheets().values().append(
spreadsheetId,
range,
new ValueRange().setValues(
values
)
).setValueInputOption("RAW").execute();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment