SOLVED

Get Emails REST API endpoint does not return preHeader and status data

Go to solution
valeryia_osos
Level 1

Get Emails REST API endpoint does not return preHeader and status data

When using the Get Emails endpoint, the NULL value is returned for the preHeader field and empty string for status field, but at the same time, when using the Get Email By Id endpoint not NULL nor empty values for the preHeader and status fields are present. I would like to know why the Get Emails endpoint returns NULL and empty values for the preHeader and status fields and can this be fixed somehow?

1 ACCEPTED SOLUTION

Accepted Solutions
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Get Emails REST API endpoint does not return preHeader and status data

Sure, but as an immediate step I’d recommend you to raise this issue with the Marketo support team.  

View solution in original post

9 REPLIES 9
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Get Emails REST API endpoint does not return preHeader and status data

Get Email by Name and Id endpoint do return the correct data for the status and preHeader parameters. However, the browse endpoint does not return the preHeader value, and it is set to NULL even for the email assets that have a pre-header set, status parameter, however, does return the correct value (approved/draft) depending on the email's status for all the endpoints. If I'm not missing anything here, this could probably be a bug where-in the get emails endpoint returns preHeader = null even when the email has got one.

 

Also FYR, an approved email with an unapproved draft version would still be returned as approved in the status parameter as the email has got an approved version already. Emails without any approved versions would be returned as status = draft.

 

valeryia_osos
Level 1

Re: Get Emails REST API endpoint does not return preHeader and status data

Sorry, I made a mistake in my question. instead of the field status should be subject.

For email, data for preHeader and subject are set. When viewing the email record with the Get Email By Id endpoint, I see the values which I set, but when using the Get Emails endpoint, I see empty values. @Darshil_Shah1 perhaps as you wrote in your answer that this is a bug for the Get Emails endpoint, I would like to know if this can be fixed?

SanfordWhiteman
Level 10 - Community Moderator

Re: Get Emails REST API endpoint does not return preHeader and status data

Debatably a bug but bear in mind there are many other “browse” API endpoints that don’t return full details, forcing you to do a “seek” call (or more than one) to get all data.

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Get Emails REST API endpoint does not return preHeader and status data

Agreed with Sandy here!

 

AFAICT, all three GET endpoints return the correct subject line (I tested it just now to be sure). 

valeryia_osos
Level 1

Re: Get Emails REST API endpoint does not return preHeader and status data

@Darshil_Shah1 The current problem is still reproducible for me.
Let me describe the steps to preproduce:
1. Create a new email, for example select the Skeleton template.

Screenshot (26).png
2. Do not approve the email, it must remain in draft status.
3. The data for the created email should be approximately the same as in the screenshot:

Screenshot (29).png

4. Go to Edit draft mode for the email you created, make sure that the Subject field is empty,

Screenshot (28).png

and also in the Email Settings, make sure that the Preheader setting is disabled.

Screenshot (27).png

4. Get email data by using Get Email By Id endpoint

Screenshot (31).png

and get data by Get Emails endpoint and find the created email in the array.

Screenshot (32).png

Compare the two endpoint results, they must be the same, and also correspond to the data which was set in Marketo.
(in the responses above, everything is expected and correct, but the problem arises when the user starts to make changes).
5. Next, go back to Edit draft mode and set the data for the Subject field,

Screenshot (33).png

and also enable the Preheader setting in the Email Settings and set the value.

Screenshot (34).png

Don't forget to save your changes.
6. Get the email data again with the Get Email By Id endpoint

Screenshot (35).png

and get data by Get Emails endpoint and find the created email in the array.

Screenshot (36).png
Compare the two results.
In my case the Get Email By Id endpoint response displays the data which was set in Marketo, but the Get Emails endpoint response says that the data is empty (the same values as before the changes were made), which is completely wrong.
Hope you can reproduce this issue.
And I want to know if it can be solved, I mean that Get Emails endpoint returns actual data in the same way that the Get Email By Id endpoint does.

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Get Emails REST API endpoint does not return preHeader and status data

Thanks for the detailed steps to reproduce and I totally get what you're saying! However, I didn't observe this discrepancy with the difference in subject lines when I approved the changes to the email. Also, this discrepancy is only observed when changes are made, and for the first time around, as you said, all the endpoints return the same results. I think probably the changes take a while to get transpired at the source of the Get Emails endpoint (or probably, Marketo is employing some sort of caching technique for that endpoint, and the data gets updated every fixed duration). Additionally, the endpoints return the data of the approved version of the email, and not any of the changes made to the draft version of the email. The above-said discrepancy is only seen when the email is not approved, as I said in the beginning.

 

Also, to clarify, these updates/fixes need to be done by Marketo's product team, and users cannot make any updates on how/what these endpoints return the data apart from the ones available in the endpoint itself.

 

valeryia_osos
Level 1

Re: Get Emails REST API endpoint does not return preHeader and status data

@Darshil_Shah1 maybe you know how to contact the Marketo's product team to find out if the behavior I described is expected or changes are required and then when they can make them?

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Get Emails REST API endpoint does not return preHeader and status data

Sure, but as an immediate step I’d recommend you to raise this issue with the Marketo support team.  

valeryia_osos
Level 1

Re: Get Emails REST API endpoint does not return preHeader and status data

@SanfordWhiteman Yes, you are right, but in this case  Get Emails endpoint returns incorrect data instead of not returning data at all.
I wrote the steps to reproduce in this comment.