I am making a request to the User.messages endpoint. All objects returned (the emails) have a mimeType property which I\'m struggling to understand.
More specificall
I resolved this using a recursive function, in this way obtains all the text of the message without import the level of depth of the Json answer. If need more explication, please tell me.
private List ObtenerTextoMensaje(IList partes)
{
var listaTextos = new List();
foreach(var elementoParte in partes)
{
if ((elementoParte.MimeType == "text/plain")|| (elementoParte.MimeType == "text/html"))
{
if (elementoParte.Body.Size != 0)
{
listaTextos.Add(decodificarBase64(elementoParte.Body.Data));
}
}
else
{
if(elementoParte.Parts!=null)
listaTextos = ObtenerTextoMensaje(elementoParte.Parts);
}
}
return listaTextos;
}