com.google.gdata.client.Service.getFeed(URL, Class<SpreadsheetFeed>) returns basic HTML!!

528 views
Skip to first unread message

Abdullah Akbar

unread,
Jun 6, 2011, 10:26:48 AM6/6/11
to google-docum...@googlegroups.com
Hello folks,
I am new around here. My java code just tries to read an already existing Google spreadsheet.

spreadSheetService.setUserCredentials("XXX", "XXX","pass","pass",ClientLoginAccountType.HOSTED);
URL spreadSheetURL = new URL(url);
spreadSheetService.getFeed(spreadSheetURL, SpreadsheetFeed.class);

Now the getFeed API throws  com.google.gdata.util.ParseException: Unrecognized content type:text/html;charset=UTF-8  :(

I inspected the response of the getFeed API and I find out that the spreadsheet response has opened in basic HTML : 
<div id="banner">You are currently viewing Google Docs in basic HTML. <a target="_blank" href="http://docs.google.com/support/bin/answer.py?answer=37560&amp;hl=en_GB">Switch to a supported browser</a> to edit and share Google Docs in real time.</div> 

Can anyone please help me out here. Thanks a ton!

Andrew Fields (Gmail)

unread,
Jun 6, 2011, 7:57:43 PM6/6/11
to Google Documents List API
Your credentials probably aren't correct. See if you can use those
credentials to do something else like get a list of folders.

Abdullah Akbar

unread,
Jun 7, 2011, 4:50:53 AM6/7/11
to google-docum...@googlegroups.com
Thanks Andrew. I found the 2 issues.
1. Wrong import 
import com.google.gdata.data.spreadsheet.SpreadsheetEntry; should be used instead of com.google.gdata.data.docs.SpreadSheetEntry.

2. The URL was also wrong. 



Reply all
Reply to author
Forward
0 new messages