Hi,

I try to read the google spreadsheet using below Java code.


      String status="";


        *try*{

        System.*out*.println("----");

         SpreadsheetService service = *new* SpreadsheetService("Print 
Google Spreadsheet Demo");

         System.*out*.println("Here  "+service);

            service.setUserCredentials(*GOOGLE_ACCOUNT_USERNAME*,  
*GOOGLE_ACCOUNT_PASSWORD*);

        System.*out*.println("Here 1");

            URL metafeedUrl = *new* URL(*SPREADSHEET_URL*);

            SpreadsheetEntry spreadsheet = service.getEntry(metafeedUrl
,SpreadsheetEntry.*class*);

            URL listFeedUrl = spreadsheet
.getWorksheets().get(0).getListFeedUrl();

        ListFeed feed = service.getFeed(listFeedUrl, ListFeed.*class*);


            *for* (ListEntry entry : feed.getEntries()) {

                System.*out*.println("new row");

                *for* (String tag : entry.getCustomElements().getTags())

{

                    System.*out*.println("     " + tag + ": "

                            + entry.getCustomElements().getValue(tag));

                    status=entry.getCustomElements().getValue(tag);

               }

            }


        }*catch*(Exception e){

            System.*out*.println(e);

        }

        System.*out*.println(status);

      }


when i run this code i got the below error.

"com.google.gdata.util.AuthenticationException: Error authenticating (check 
service name)"


Could you please help me on this.

-- 




GROFERS


Download App <http://grofers.com/download>

Follow us: 
Facebook <http://www.facebook.com/Grofers> :: Twitter 
<https://www.twitter.com/grofers> :: Instagram 
<https://www.instagram.com/grofers/>


 <https://grofers.com/>

 
<https://grofers.com/>






-- 
You received this message because you are subscribed to the Google Groups 
"Google Spreadsheets API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-spreadsheets-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-spreadsheets-api/6614ff47-0137-4cce-adca-d299b7d6daa5%40googlegroups.com.

Reply via email to