In Google Apps Script, I am using the AdminDirectory Api to get a user photo from the admin console.
The returned object shoud have a string containing the photo encoded as base64, but I can only get an object of numbers.
function hentSkolefoto() {
var photo = AdminDirectory.Users.Photos.get("bend0006@thistedskoler.dk");
Logger.log(typeof(photo.photoData));
Logger.log(photo.photoData.toString());
}
The log output says:
object
Logging output too large. Truncating output. [-1.0, -40.0, -1.0, -32.0, 0.0, 16.0,...
How do I decode and - ultimately - show the photo on a web page?
I have tried to add "toString()":
Logger.log(photo.photoData.toString())
Log output:
Logging output too large. Truncating output. -1,-40,-1,-32,0,16,...
I have also tried to decode as suggested here.