0

After looking for a way to interact Java with google spreadsheet api, I gave up. In the documentation, there is no clear example code for java to use OAuth 2 authentication. My end goal is to edit a spreadsheet using java. I already figured out how to receive data from spreadsheet. If anyone can help, that would be great! Java Code Missing

Link to Spreadsheet API Documentation: https://developers.google.com/google-apps/spreadsheets/

7
  • 1
    This is very unclear, which makes it difficult to help. Can you provide an example (see stackoverflow.com/help/mcve) with the code you have already tried and the error messages you received? Commented Nov 21, 2015 at 20:02
  • The problem is that I do not know what to code in the first place. The documentation provides sample code for .NET, but there is no code for java. Thanks again. Commented Nov 21, 2015 at 20:04
  • If whatever you are using for a language can make an HTTPS GET or POST request, you can create a Stand Alone Apps Script using Content Service, that can act as an intermediary between your App and a Google Spreadsheet. A Stand Alone Apps Script can be triggered to run over the internet with a GET or POST request. Commented Nov 21, 2015 at 20:05
  • Alright, I am using java. I know that java can send GET and POST requests. Now how again would I use this to communicate to Spreadsheets? Thanks. Commented Nov 21, 2015 at 20:08
  • Apps Script automatically runs a function named doGet() or doPost() when the URL to the script is used in the browser. You can pass information to Apps Script. With doGet() you pass information in the URL's search string. With a POST request, I think it's part of the payload. You might also want to ask about OAuth 2 for Java in the Apps Script group. Google Apps Script Community Commented Nov 21, 2015 at 20:18

1 Answer 1

1

here is the library you are looking for. it uses the google gdata library. it's an outdated library but its the only one available and the spreadsheet api is also outdated and the only one that google has made available.

https://developers.google.com/gdata/javadoc/com/google/gdata/data/spreadsheet/package-summary

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks so much, this is what I think can be used to help me figure this thing out!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.