Export delivery reports
POST/api/partner-gateway/exports/delivery-reports
Queues an export of delivery reports, that is the send and delivery status of each message, as a CSV file (the default) or an Excel file.
- What to export: either
campaignId, for the reports of one campaign, orstartDateTimeandendDateTimetogether, for every report of that period. sendTypenarrows the messages to those sent from the web platform (WEB), through the API (API) or both (WEB_API, the same as leaving it out of a date-range export). AcampaignIdcan be combined only withWEBor with nosendType.- Optional filters:
sender,recipientandsubAccountId. They do not apply to every message: the table below says which. - Masked destinations: in the file, the last three characters of every destination are replaced by
***. - The answer is
202with an empty body, so without an export ID: the job is queued, not completed. - Get the file: poll
GET /exportsevery 5-10 seconds. The export is listed only once its file is ready, already withisAvailableForDownloadtrue. Then callGET /exports/{exportId}with itsidfor the download URL. An export whose generation fails is never listed.
Which messages each optional filter applies to
| Filter | Applies to |
|---|---|
recipient | Every message. |
sender | On the messages of a campaign or of the web platform, the SMS sender: their RCS and WhatsApp messages are left in. On the messages sent through the API, the SMS sender, the RCS agent or the WhatsApp number. |
subAccountId | Only the messages sent through the API. |
After the export expires you can regenerate it with POST /exports/{exportId}: the new export keeps all of its filters and is listed under a new ID.
Request
Responses
- 202
- 400
- 401
- 500
Export queued. No response body.
The body is missing or invalid: neither campaignId nor both startDateTime and endDateTime, only one of the two dates, campaignId together with the date range or with sendType API or WEB_API, or a malformed value such as a date in another format or an unknown sendType. The response body names the reason.
The API key is missing, invalid, or lacks the EXPORTS operation.
Unexpected server error.