Last active
March 16, 2018 07:43
-
-
Save ruseel/7ef9e82540781438282aaa353eea45bb to your computer and use it in GitHub Desktop.
spreadsheet.values.append java example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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