Promotions API methods
Get all promotions
GET https://api.madmimi.com/promotions.xml
Returns an xml formatted result containing all promotions and the mailings sent for those promotions
Optional parameters:
page
to set the current page to fetch. Results will be returned 20 per page.
Search promotions
GET https://api.madmimi.com/promotions/search.xml?query=[query]
Returns an xml formatted result containing all promotions whose name matches [query].
Optional parameters:
api_mailings
to set whether or not to include API mailings in the results (default: false).
from_date
and to_date
for restricting results to a date range:
GET https://api.madmimi.com/promotions/search.xml?date=1&from_date=[date1]&to_date=[date2]
Returns an xml formatted result containing all promotions whose date is between date1
and date2
where the date is in the format YYYY-MM-DD hh:mm:ss
GET https://api.madmimi.com/promotions/search.xml?id=[promotion_id]
Returns an xml formatted result for the promotion with the id [promotion_id].
GET https://api.madmimi.com/promotions/search.xml?name=[exact_name]
Returns an xml formatted result for the promotion whose exact name was specified.
Save a promotion
POST https://api.madmimi.com/promotions/save
If successful, returns "Saved [promotion_name] ([promotion_id])"
Parameters:
promotion_name
The name of the promotion to create or update.
raw_html
The custom HTML for the promotion. Can be used on its own or in conjunction with raw_plain_text
.
raw_plain_text
The custom plain text for the promotion. Can be used on its own or in conjunction with raw_html
.
url
The URL containing content to be used for the promotion. Use this parameter instead of sending raw_html
or raw_plain_text
.
Trash a promotion
PUT https://api.madmimi.com/promotions/[id]/trash
Trashes the promotion with the supplied id