Download Campaign Report
curl --request GET \
--url https://api-{dc}.moengage.com/campaign_reports/rest_api/{APP_ID}/{FILENAME} \
--header 'Signature: <api-key>'"<string>"{
"error": {
"attribute": "<string>",
"message": "<string>",
"type": "BAD REQUEST",
"request_id": "<string>"
}
}{}Download Campaign Report
This API downloads campaign reports for any specific date range. You can fetch reports for one-time and periodic campaigns.
GET
/
campaign_reports
/
rest_api
/
{APP_ID}
/
{FILENAME}
Download Campaign Report
curl --request GET \
--url https://api-{dc}.moengage.com/campaign_reports/rest_api/{APP_ID}/{FILENAME} \
--header 'Signature: <api-key>'"<string>"{
"error": {
"attribute": "<string>",
"message": "<string>",
"type": "BAD REQUEST",
"request_id": "<string>"
}
}{}Limits
- Expiry: The generated reports will expire in 7 days from the date of creation.
- Max Range: You can generate reports for up to 90 days.
Generating the Signature
A unique signature must be passed in the headers to verify the caller’s authenticity. The signature isSHA256(Api_ID + "|" + FILENAME + "|" + SECRET_KEY).
# SAMPLE IMPLEMENTATION IN PYTHON
from hashlib import sha256
Api_ID = "YOUR-APP-ID"
FILENAME = "Report_-_test_20210217.zip"
SECRET_KEY = "YOUR-SECRET-KEY"
Signature_Key = Api_ID + "|" + FILENAME + "|" + SECRET_KEY
# Now Signature is hexdigest of sha256 of Signature_Key
Signature = sha256(Signature_Key.encode('utf-8')).hexdigest()
Headers
A custom signature generated by SHA256(Api_ID + "|" + FILENAME + "|" + SECRET_KEY).
Path Parameters
This is the Workspace ID of your MoEngage account that must be passed with the request. You can find it in the MoEngage dashboard at Settings > Account > APIs > Workspace ID (earlier app id).
The name of the report file to download. It is a combination of report name, generation date, and file format.
Example: Report_test_20210217.zip
Response
Successful API request automatically downloads the report file.
The response is of type file.