java - Error exporting a document in google docs api -


i'm trying retrieve document this:

  client.setauthsubtoken(token);   string contenturi = "https://docs.google.com/feeds/download/documents/export?docid="+ entry.getdocid()                             + "&exportformat=txt&format=txt";    mediacontent mc = new mediacontent();   mc.seturi(contenturi);    mediasource ms = client.getmedia(mc);   inputstream instream = ms.getinputstream(); 

but getting next error:

com.google.appengine.repackaged.org.apache.http.impl.client.defaultrequestdirector handleresponse advertencia: authentication error: unable respond of these challenges: {authsub=www-authenticate: authsub realm="https://www.google.com/accounts/authsubrequest"}

do not why if client authenticated, hope 1 can help, in advance.

maybe help:

  1. replace docid parameter id parameter

    contenturi = "https://docs.google.com/feeds/download/documents/export/export?id=" + entry.getdocid() + "&exportformat=txt&format=txt"; 
  2. use directly method obtaining uri (this recommended)

    string contenturi = ((mediacontent) entry.getcontent()).geturi(); contenturi = contenturi + "&exportformat=txt&format=txt"; 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -