curl --request POST \
--url https://api-{dc}.moengage.com/v1/coupon-list/{coupon_list_id}/files \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'MOE-APPKEY: <moe-appkey>' \
--data '
{
"file_url": "<unknown>",
"name": "<unknown>",
"file_url_auth_username": "<string>",
"file_url_auth_password": "<string>",
"created_by": "<unknown>",
"callback_url": "<unknown>"
}
'{
"name": "<string>",
"file_url": "<string>",
"created_by": "<string>",
"status": "<string>",
"coupons_list_id": "<string>",
"_id": "<string>"
}Upload a Coupon File to the Coupon List
After you create a coupon list, you must add coupons to the list to be distributed through campaigns. If a coupon list has been running for some time, it may be running low after serving several campaigns.
Using this API, you can replenish an older list or populate a new list by providing the URL of a file containing the coupons, thereby enabling their distribution through various campaigns. These coupons can be provided through a file, and the API requires the URL where your coupon file is hosted.
curl --request POST \
--url https://api-{dc}.moengage.com/v1/coupon-list/{coupon_list_id}/files \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'MOE-APPKEY: <moe-appkey>' \
--data '
{
"file_url": "<unknown>",
"name": "<unknown>",
"file_url_auth_username": "<string>",
"file_url_auth_password": "<string>",
"created_by": "<unknown>",
"callback_url": "<unknown>"
}
'{
"name": "<string>",
"file_url": "<string>",
"created_by": "<string>",
"status": "<string>",
"coupons_list_id": "<string>",
"_id": "<string>"
}- For convenience, you can set up a callback URL to trigger when the file’s processing is completed.
- You can check the processing status using the Fetch a Coupon File API to get the status separately.
Rate Limit
You can upload:- 5 coupon files to a coupon list per minute or
- 50 coupon files to a coupon list per day
- Payload size limit: 64 MB for manual uploads or 100 MB for URL uploads.
- Additional limits: The maximum number of coupons per coupon list is 100 million.
承認
Authentication is done via Basic Auth. This requires a base64-encoded string of your credentials in the format 'username:password'.
- Username: Use your MoEngage workspace ID (also known as the App ID). You can find it in the MoEngage dashboard at Settings > Account > APIs > Workspace ID (earlier app id).
- Password: Use your API Key, which you can find within the Campaign report/Business events/Custom templates/Catalog API/Inform Report tile.
For more information on authentication and getting your credentials, refer here.
ヘッダー
ボディ
レスポンス
Success The request was successful, and the coupon URL upload request was accepted.
Note: The status of the URL upload is always PENDING.