I am testing how to update user picture using the Admin SDK Directory Service with Google Apps Scripts with the following function:
function updatePhoto(){
The API requires you to use URL-safe base64 encoding. After doing the base64 encoding, try replacing / with _ and + with -. Details at:
/
_
+
-
https://developers.google.com/admin-sdk/directory/v1/reference/users/photos/update