Search code examples
reactjsgmail

Reactjs gmail integration vs oauth GCP


Can anyone provide some guidance on accessing gmail apis (get emails, create emails). I setup oauth on GCP and received an access token via react-google-login. I juust dont know which endpoints to use it for. the google documentation is a little sparse. links to documentation is much appreciated! thanks!


Solution

  • Figured it out. i need to pass in the scope to the react-google-login package. afterwards i get a tokenObj which contains the access token which i can add as a Bearer to call the google endpoints here

    https://developers.google.com/gmail/api/reference/rest/v1/users.threads/get

    ^^ apis

    https://developers.google.com/identity/protocols/oauth2/scopes#gmail

    ^^ scopes