0

Hello I have created node project in which I am trying to update user photo in G-suite using admin-sdk/directory API I am passing base64 image from postman and converting it to web-safe base64 bytedata

req.body.photoData.replace(/\//g, '_').replace(/\+/g, '-').replace(/\=/g, '*')

above regex will replace string as per the google doc for photo bytedata but I am getting bad request of Invalid value for ByteString

I a following this doc

https://developers.google.com/admin-sdk/directory/v1/reference/users/photos

suggest me if anyone have answer of it.

Kalpesh Kashyap
  • 824
  • 11
  • 18

1 Answers1

0

U dont need to replace the = character, just replace / and +.

hotfix
  • 3,376
  • 20
  • 36