๐ Use Case
Trigger SendGrid email activity export via API and check:
Which email will receive the CSV
Which API key (token) is being used
๐ API Call Endpoint
POST https://api.sendgrid.com/v3/messages/download
Authorization
Bearer <SendGrid API Key>
Sample Body
Json
{
"query": "last_event_time BETWEEN TIMESTAMP \"2026-02-01T00:00:00Z\" AND TIMESTAMP \"2026-02-06T23:59:59Z\""
}
✅ Response
Json
{
"status": "pending",
"message": "An email will be sent to qa@abc.com.hk when the CSV is ready to download."
}
HTTP Status: 202 Accepted
๐ฌ What This Means
202 → Export request accepted.
The response message clearly shows which email will receive the CSV.
The Bearer Token (API Key) used determines:
The SendGrid account/subuser
The email that gets the notification
Permission scope
๐ข OIC Tip
Store API key in Vault, log the response, and extract the email dynamically for tracking.
Simple, automated, and no need to check SendGrid UI manually. ๐

No comments:
Post a Comment