Gmail API

I spent a whole week struggling with the Gmail API, but without success.

My task:

  • create a mailbox with a custom domain;
  • connect to this mailbox via Gmail API using service account.

What I did:

  1. Created an account in Google Workspace (14 days free of charge) and verified the domain by receiving a work mailbox with a custom domain:

  2. Gave the account the rights of the owner: 2

  3. Created a project within the organization:

  4. Created a service account in the project:

  5. Added a key:

  6. Added Gmail API to the project:

  7. In Google Workspace, I added delegation of access to data in the domain:

  8. Created a JWT token in a Wappler with full access to gmail:

  9. Created OAuth2 provider:

  10. Created an API action with a request for a list of messages:

However, I always get an error:
11

I note that I can easily recreate this manual without any errors:

Also, I have already read all the guides from google a hundred times and done everything that was indicated in them.

@Teodor, @psweb, @patrick what could I have missed?

I would be very grateful for any help to the community.

1 Like