Unable to retrieve Email FullContents via API for certain Activities

Reid_B
Level 1

Unable to retrieve Email FullContents via API for certain Activities

Via the Rest API Bulk Activity export, I have pulled a list of Activities that were performed within the last few months. Each Activity has a value in the "primaryattributevalueid" field which I assume ties to the ID from the Email API. Now, I need to get some more info for those Activities, such as the actual email HTML.

 

I have also pulled (what I believe) is a full list of emails via the Browse method:
https://123-ABC-456.mktorest.com/rest/asset/v1/emails.json?maxReturn=200

 ( this returns a list of ~150 emails; well under the 200 limit so need to deal with page offsets).

 

My problem is that I am seeing a lot of Activities with primaryattributevalueid that do NOT have corresponding email ID's from the email API. I believe this can be attributed to the following warning on the API docs here - https://developers.marketo.com/rest-api/assets/emails/#query  which states that emails that were part of Testing aren't returned by the the 'browse' API.

 

Assuming everything stated above is accurate, I believe I still should have a method of getting the contents of the Email via the FullContents method.  For example:

"https://123-ABC-456.mktorest.com/rest/asset/v1/email/2335/fullContent.json"  SHOULD return the contents for activity 2335. But instead, I get the following API response:
"errors":[{"code":"702","message":"Email not found"}]}; 

 

Any thoughts on what I need to fix, or alternate methods for pulling Email Content data to attach it to Activities?

 

Tags (1)
3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Unable to retrieve Email FullContents via API for certain Activities

I think the phrase

 

... that email is not available for query using the following endpoints: Get Email by Id...


is meant to include the implicit sub-resources of /rest/asset/v1/email/{id}.json, including fullContent.

 

 

Reid_B
Level 1

Re: Unable to retrieve Email FullContents via API for certain Activities

If what you are saying is true, according to the API docs I should be receiving the response:

"No assets found for the given search criteria.” 

 

Instead, the actual response is:

"errors":[{"code":"702","message":"Email not found"}]};   

 

In any case, if what you are saying is correct, is there another way to get the HTML content of an email that is part of a program using email testing?

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Unable to retrieve Email FullContents via API for certain Activities

None that I know of, it's one of the "invisibles" from an API standpoint.