get sent or recieved emails from sendgrid

We're using SendGrid for email service for a project backend.

Now, we want to set up e2e tests for the project. To get a well-verified user, we have to know the verification code sent to the user's email at the time of the registration.

I've tried with the messages endpoint as:

curl --request GET \
  --url \
  --header 'Authorization: Bearer SG.xxxxxxxxxxxxxxxxxxxxxxxxx' \
  --header 'Content-Type: application/json'

But the response says:

{"errors":[{"message":"authorization required"}]}

Is there any way that we can get the sent emails using the SendGrid API?

Thank you in advance.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum