Get Report Export
print_mail.reports.exports.retrieve(strexport_id, ExportRetrieveParams**kwargs) -> ReportExport
GET/print-mail/v1/reports/{reportID}/exports/{exportID}
Retrieve the status and details of a specific report export job.
Check the outputURL property for the download link once generation is complete.
Get Report Export
import os
from postgrid import PostGrid
client = PostGrid(
print_mail_api_key=os.environ.get("POSTGRID_PRINT_MAIL_API_KEY"), # This is the default and can be omitted
)
report_export = client.print_mail.reports.exports.retrieve(
export_id="exportID",
report_id="reportID",
)
print(report_export.id){
"id": "report_export_123",
"object": "report_export",
"live": false,
"report": {
"id": "report_123",
"sqlQuery": "SELECT id, status FROM orders WHERE created_at > ?"
},
"params": [
"2023-10-01T00:00:00Z"
],
"description": "October Orders Export",
"outputURL": "https://s3.amazonaws.com/...",
"sizeInBytes": 1024,
"rowCount": 50,
"createdAt": "2023-10-27T11:00:00Z",
"updatedAt": "2023-10-27T11:05:00Z"
}Returns Examples
{
"id": "report_export_123",
"object": "report_export",
"live": false,
"report": {
"id": "report_123",
"sqlQuery": "SELECT id, status FROM orders WHERE created_at > ?"
},
"params": [
"2023-10-01T00:00:00Z"
],
"description": "October Orders Export",
"outputURL": "https://s3.amazonaws.com/...",
"sizeInBytes": 1024,
"rowCount": 50,
"createdAt": "2023-10-27T11:00:00Z",
"updatedAt": "2023-10-27T11:05:00Z"
}