Skip to main content
API_Dev
Level 2
March 28, 2018
Question

Get email data of an email inside a program via API

  • March 28, 2018
  • 1 reply
  • 4817 views

Hi All,

So I'm looking at this API endpoint reference:http://developers.marketo.com/rest-api/endpoint-reference/asset-endpoint-reference/#!/Emails/getEmailByNameUsingGET and there's an option to pass folder related data as JSON representation as mentioned here: http://developers.marketo.com/rest-api/assets/emails/#by_name but when I'm trying to test it on Postman I get the message that the "Folder id is not valid". I'm just trying to figure out what is the correct method to pass that json representation besides the email name to the GET request endpoint url. Surely I don't want to treat mkto nation as stackoverflow, though it would be great help in my code with your suggestions/recommendations.

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Jim_Thao7
Level 8
March 28, 2018

Declare a Folder ID and pass it in a param.  If your folder ID is "97" then your url should look like this:  /rest/asset/v1/email/byName.json?folder=97

Note there is a difference between folders and programs.

Here's a full endpoint for reference: /rest/asset/v1/email/byName.json?accesstoken=something&name=something&folder=97

API_Dev
API_DevAuthor
Level 2
March 29, 2018

Hi Jim,

Thank you for your response. Appreciate it, although I want to know if I want to pass the Id of the program and not the folder, would I be defining the program Id in the same manner or follow some other syntax? The email whose data I want to read resides in an email blast program.

Thanks.

SanfordWhiteman
Level 10
March 30, 2018

Well, the example in the docs is wrong (this happens) as the JSON is broken (using = after the property name instead of :, and it also uses curly quotes!).

If you pass well-formed JSON you'll be fine:

folder={"id":3789,"type"="Program"}

which of course goes on the wire as

folder%3D%7B%22id%22%3A3789%2C%22type%22%3D%22Program%22%7D

or you can (I don't know if this is documented) use the shorthand

program=3789

You can't do exactly what Jim said for emails as they only support Programs (folder type=Program) as parents.