0

I wish to create a Google App that will, upon approval by the user, automatically add a specific forwarding address to their Gmail.

When trying to hit the https://www.googleapis.com/gmail/v1/users/me/settings/forwardingAddresses endpoint with the https://www.googleapis.com/auth/gmail.settings.sharing (Gmail V1 API) scope selected, I see the following error when the app has been authorized by a regular Gmail account:

    {
  "error": {
    "code": 403, 
    "message": "Access restricted to service accounts that have been delegated domain-wide authority", 
    "errors": [
      {
        "domain": "global", 
        "message": "Access restricted to service accounts that have been delegated domain-wide authority", 
        "reason": "forbidden"
      }
    ]
  }
}

When authorizing the app with a Google service account (AAA@BBB.iam.gserviceaccount.com) I see a Google couldn't verify this account belongs to you error after trying to sign in.

Is approving the app with a service account a must for hitting this API and if so, how would I authorize the app with the service account from the playground?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.