[SalesForce] How does the ExactTarget Email preview REST API work

I am trying to make a rest call to ExactTarget to preview Email. But the REST API is not returning the response for all the Emails on ExactTarget. Sometimes the API does return Email for preview while at other times it returns 500 Server Error.

I am calling

https://www.exacttargetapis.com/guide/v1/emails/{ET email id}/preview

API using:

curl -X POST -H "Authorization: Bearer {access token}" -H "Cache-Control: no-cache"  https://www.exacttargetapis.com/guide/v1/emails/{ET email id}/preview?kind=html,text

but I get

 {
"documentation": "https://code.docs.exacttarget.com/rest/errors/500",
"errorcode": 0,
"message": "Internal Server Error"
}

in response for few Emails ids (not for all Emails on ExactTarget). I am using Email id which is shown in the ExactTarget Web UI.

And I also ensured that access token is valid using "/platform/v1/tokenContext/ " API.

So can anyone help me understand how does this API work and under what conditions do I get these kind responses? Also it will be great help if you could direct me to a list of ExactTarget REST API's and its proper documentation.

Best Answer

There's a similar answer here. It could be the emails returning an error have an issue. Try validating the email before previewing. The route you are using returns dummy data. If you want to preview for actual contact data, there are a couple of other choices.


list: 'fuelapi/guide/v1/emails/{docID}/lists/{listID}/contacts/{rowID}/preview?kind=html'
DE: '/fuelapi/guide/v1/emails/{docID}/dataExtension/id:{listID}/contacts/{rowID}/preview?kind=html'

I don't believe there is a route that allows for multiple DE's. However, you can try creating a model in Contact Builder that consolidates several DE's.