Solved

Retrieve only text from Messages (avoid thread and signature)

  • 14 December 2023
  • 4 replies
  • 47 views

Badge +1

Hello:

I was wondering which would be the best way to retrieve the important information in the body of a message through the API.

Actually, I am retrieving all the messages from a conversation through the endPoint:
https://api2.frontapp.com/conversations/{cnv_id}/messages

Then, I get the text of the message through the property:

_results[x].text

But it gets to a point in the conversation where signatures and threads are included in the text property.

Is this related to the way email clients deal with the emails? Or is there a better way to retrieve this information from the API?

Thanks a lot for your time.
My best regards.
Juan.

icon

Best answer by Juan 18 December 2023, 07:34

View original

4 replies

Badge +1

Ok, so it looks like Front handles the “text” and the “Signature and thread” separation wonderfully, but the answers from the recipient come with the teammate’s signature and thread inside the text property.

Have you found out a way to separate them in the recipients answers?

Thanks.

Userlevel 3
Badge +7

Hi, Juan! 

Since this is all received as part of the body of the message, they will appear together. While we don’t have a universal solution for parsing signatures out, you may consider investigating if there any common elements or patterns in the types of messages you are requesting via API. If so, you could implement some logic on your end to parse out this information from the payload. 

Userlevel 5
Badge +8

@Juan Also, please feel free to leave an idea on our Ideas portal. I’m imagining this could potentially be handled by AI down the line

Badge +1

Thanks a lot for your answers. Really appreciate them.

I will try to find common strings that wrap the footer and threads and delete them manually programatically.

My best regards.

Reply