Accessing emails and running campaigns via REST API | Community
Skip to main content
Vlada_Prasolova
Level 5
Jul 19, 2016 1:17 PM UTC
Solved

Accessing emails and running campaigns via REST API

We are trying to launch an automated email that consists of our product blog content to be sent every time there is a new blogpost worth sending out.

It turns out that that in order to do this via API calls we need is to be able to clone a program, update its email body and schedule corresponding campaign when we think that we have new content to send.

The problem is that I don’t see an easy way to update content of an email (not headers but actual body). As i see from API documentation, everything that I can do in order to update email body is to call updateEmailTemplateContentById with email’s corresponding template and it doesn’t affect approved templates.

So the question is how can I update existing email body via REST API? Does our workflow look ok?

Or may be there is a much more simple way of doing this that i'm missing out?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Kenny_Elkington
Kenny_ElkingtonAccepted solution
Level 10
Jul 19, 2016 4:21 PM UTC

The typical flow is not to update the email asset itself, but to use a My Token instead of having embedded content.  You then pass your syndicated content in as a replacement my token via the Schedule Campaign call, similarly to what's shown here: http://developers.marketo.com/blog/sending-transactional-emails-with-the-marketo-rest-api-part-2-custom-content/​

5 replies

Kenny_Elkington
Kenny_ElkingtonAccepted solution
Level 10
Jul 19, 2016 4:21 PM UTC

The typical flow is not to update the email asset itself, but to use a My Token instead of having embedded content.  You then pass your syndicated content in as a replacement my token via the Schedule Campaign call, similarly to what's shown here: http://developers.marketo.com/blog/sending-transactional-emails-with-the-marketo-rest-api-part-2-custom-content/​

Translate
Vlada_Prasolova
Level 5
Jul 20, 2016 10:20 AM UTC

Our average email size will be a couple of kilobytes. So are we able to transfer whole content of an email through My Token? Right?

Translate
SanfordWhiteman
Level 10
Jul 20, 2016 5:48 PM UTC

Sure.

Translate