2

I am writing a code in salesforce to update Email signature using the API documentation mentioned in https://developers.google.com/admin-sdk/email-settings/. I am using a 3 legged approach.

Considering that this is an API for domain admins, My questions is

can a user ( non - admin) provide authorization for this API ?.

And can the access token returned as a result of this authorization be used to update his email signature. ?

Right now I am getting an Error 403- "you are not authorized to access this API

Note that this is working fine if a domain admin provide authorization and his access token is used to update his/ any user's email signature

Thanks for your help

Bijay Negi
  • 21
  • 1
  • 2
  • As per my understanding, you cannot authorize API as a user. If you really want to give access to the user, you can add him as a admin for that domain. – KRR Jul 23 '15 at 22:25
  • @KRR Do you mean we cannot authorize API as a user for Email setting API or for any google api ? – Bijay Negi Jul 24 '15 at 05:37
  • Sorry for the confusion. I meant for Email settings API. The Email API from Google is meant for Admins to modify user settings, not for users to modify user settings. You need to authenticate with the admin credentials and then post with the appropriate google username. Hope that explains clearly. – KRR Jul 28 '15 at 17:33

1 Answers1

1

With the new updates on the GMAIL Api you can get the user signature by using the method "Users.settings.sendAs: get" explained here https://developers.google.com/gmail/api/v1/reference/users/settings/sendAs/get and it does not require the user to be an admin. This method returns a Users.settings.sendAs resource in the response body and this resource contains the property signature which you can manipulate.

Hope it helps!

Morfinismo
  • 4,985
  • 4
  • 19
  • 36