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?
Solved! Go to Solution.
Sure, but as an immediate step I’d recommend you to raise this issue with the Marketo support team.
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.
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?
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.
Agreed with Sandy here!
AFAICT, all three GET endpoints return the correct subject line (I tested it just now to be sure).
@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.
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:
4. Go to Edit draft mode for the email you created, make sure that the Subject field is empty,
and also in the Email Settings, make sure that the Preheader setting is disabled.
4. Get email data by using Get Email By Id endpoint
and get data by Get Emails endpoint and find the created email in the array.
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,
and also enable the Preheader setting in the Email Settings and set the value.
Don't forget to save your changes.
6. Get the email data again with the Get Email By Id endpoint
and get data by Get Emails endpoint and find the created email in the array.
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.
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.
@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?
@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.