Is there a way to get the actual html file in Mailchimp API 3.0?
I tried this method, /3.0/templates/{template-Id}?apikey={myAPIkey}
but it's not returning the actual file, it's giving me the thumbnail of the template.

- 14,436
- 26
- 44
- 46

- 101
- 1
- 3
4 Answers
There is currently no single API call to get the HTML source for a template as there is in API 2.0. Below is the reply I got from MailChimp support on December 9th, 2016:
Thanks for reaching out to us with your question. At this time, API 3.0 does not contain a direct corollary that allows for the "source" of a Template to be retrieved. However, we are continuing to update the 3.0 version of the API in hopes of achieving parity with 2.0, so I will be passing this feedback along internally to our team. In the meantime, the only workaround available for retrieving the HTML in the same format would be to create a Campaign using the Template in question and then retrieve the source using the /campaigns/{campaign_id}/content endpoint.

- 339
- 2
- 8
-
52.5 years since this answer and it is still not available :( – Raj Nov 15 '18 at 00:01
-
3Make that 3 years. I talked to support in hopes it get passed to the team. – Andries May 27 '19 at 07:57
-
1it's pretty obvious to me that this was removed on purpose: to send emails with mailChimp templates, you need to use Mandrill, which requires to have a paid MailChimp account and $20 per block of emails per month. Too many have abused the free mailchimp, building templates there and pulling the html out to send emails with the free mailgun or sendgrid accounts. – MrE Jun 27 '19 at 22:23
require_once('..includes/Mailchimp/Mailchimp.php');
$apiKey = "apikey-usx";
$mailchimpObj = new Mailchimp($apiKey);
printr($mailchimpObj->template['your template id here']);
echo "<pre>";
See the working API: https://devsnook.com/get-mailchimp-template-html-content/

- 1
- 1
You're looking for the default-content
sub-object. Check out the documentation page for that endpoint here.

- 4,583
- 2
- 17
- 21
-
2it's not returning a complete html file and on my request, the "sections" part is blank. – TheDevGirl Apr 12 '16 at 01:59
-
That sounds like something you should reach out to MailChimp support about -- they might be able to help you get what you need. – TooMuchPete Apr 12 '16 at 16:49