0

Hi I'm trying to show contact photo using google apps script, this is what i have so far. so i connect successfully to contacts, take first one, it's id, then i authenticate using OAuth, load full contact profile, i even have a link to the photo, but it won't show. I read somewhere that adding access token to link would help but where to get this token from?

function doGet() {
  var app = UiApp.createApplication();
  var c = ContactsApp.getContacts();
  c1 = c[0];
  var options = OAuthApp.getAuth('contacts','http://www.google.com/m8/feeds'); 
  var response = UrlFetchApp.fetch(c1.getId().replace(/base/,'full')+"?alt=json&v=3.0", options); 
  var object  = Utilities.jsonParse(response.getContentText());
  app.add(app.createImage(object.entry.link[0].href));
  return app;
}

When i'm using UrlFetchApp.fetch (that includes options paramer that include authorisation) it loads the image data, but i don't know how to authorise app.createImage instead.

adax2000
  • 424
  • 1
  • 3
  • 17

1 Answers1

0

UiApp can't display private images. Star issue 912 http://code.google.com/p/google-apps-script-issues/issues/detail?id=912

mzimmerman
  • 910
  • 6
  • 13