Python integration
import python-genai # Use an OAuth2 access token client = python_genai.Client(access_token="YOUR_ACCESS_TOKEN")
curl \
-H "Authorization: Bearer $ACCESS_TOKEN" \
https://gmail.googleapis.com/gmail/v1/users/{userId}/draftscurl \
-H "Authorization: Bearer $ACCESS_TOKEN" \
https://gmail.googleapis.com/gmail/v1/users/{userId}/labelscurl \
-H "Authorization: Bearer $ACCESS_TOKEN" \
https://gmail.googleapis.com/gmail/v1/users/{userId}/history