title: Google spreadsheet API, 400 error bad request : unable to parse range
body: <p>I am trying to access Google spreadsheets using a spreadsheet example. When I run the example code it worked fine. I just change the <strong>SpreadsheetId</strong> and range. It started giving me:</p>
  
  <pre><code>Exception in thread "main" com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
  {
    "code" : 400,
    "errors" : [ {
      "domain" : "global",
      "message" : "Unable to parse range: Class Data!A2:A4",
      "reason" : "badRequest"
    } ],
    "message" : "Unable to parse range: Class Data!A2:A4",
    "status" : "INVALID_ARGUMENT"
  }
      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 poc.mainPOC.main(mainPOC.java:157)
  </code></pre>
  
  <p>Below is the code:</p>
  
  <pre><code>  String spreadsheetId = "my spread sheet ID";
      String range = "Class Data!A2:A4";
      ValueRange response = service.spreadsheets().values()
          .get(spreadsheetId, range)
          .execute();
  </code></pre>