0

I want to read the data from one of the public spreadsheet which is in pubhtml.

How can I read above spreadsheet using google-api?

I already tried following steps but getting an error:

  1. I used google API doc with my spreadsheet id.

  2. Example:

sheet-id- 2PACX-1vTe-
Cmpii1CsnufmSER7ObEuhBb4TGO29RRwcEAQjW8PYkHKQMfUvriPk2LPXyCm8HMKCIvNFXSqJkU
  1. Error:
Exception in thread "main" com.google.api.client.googleapis.json.GoogleJsonResponseException: 404 Not Found
{
  "code" : 404,
  "errors" : [ {
    "domain" : "global",
    "message" : "Requested entity was not found.",
    "reason" : "notFound"
  } ],
  "message" : "Requested entity was not found.",
  "status" : "NOT_FOUND"
}
    at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:146)
    at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
    at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:321)
    at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1065)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
    at Quickstart.main(Quickstart.java:108)

Process finished with exit code 1

Does anyone know what's wrong?

1 Answer 1

0

Make sure you're providing the correct spreadsheetID. Error implies there's no spreaddsheet found.

You can use this spreadsheets.values.get Try-it to validate that. If it gives off the same error, it means you need to recheck your spreadsheetID.

This is what a spreadsheetID looks like:

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

spreadsheetID:

1qpyC0XzvTcKT6EISywvqESX3A0MwQoFDE8p-Bll4hps

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

6 Comments

thanks for the help. check this url,this is spead-sheet ( [link] docs.google.com/spreadsheets/d/e/… ) and hope spead-sheet id will be like - ** 2PACX-1vTe-Cmpii1CsnufmSER7ObEuhBb4TGO29RRwcEAQjW8PYkHKQMfUvriPk2LPXyCm8HMKCIvNFXSqJkU .** and i tried with your api there also getting same error: ` { "error": { "code": 404, "message": "Requested entity was not found.", "status": "NOT_FOUND" } } `
is that spreadsheet yours? I updated my answer for what a spreadsheetID looks like.
spread -sheet is not mine. that is one of the business center share with public to see daily activity. i want to read that value in my java code.
can you share the spreadsheet link, just to confirm? If you're using correct spreadsheetID, then the issue might be permissions wherein you're not allowed to access.
|

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.