List Comments API | Community
Skip to main content

List Comments API

  • December 15, 2023
  • 1 reply
  • 0 views

Souzan

Hi there,

I am trying to get the last customer comment using Zenpy and by calling the comments API 

 

https://subdomain.zendesk.com/api/v2/tickets/ticket_id/comments

But if the customer send two consecutive messages 

( meaning that the agent did not send or reply to the Customer first message )

the last comment body in the API response  will be something like below : 

 

 {

            "id": 15781536622482,

            "type": "Comment",

            "author_id": 15475246653586,

            "body": "Hi \n\n\nOn Fri, Dec 15, 2023 at 10:51 AM Souzan Hussien <souzanhussien742@gmail.com> wrote:\n\n> Hello",

.............
where the first message was "Hello" and the next one was "Hi"
noting that i am using email and web  channels
Is there another API or different way to get just the main text content of the message 
 
Regards.

1 reply

Hi Souzan,
 
If this is a conversation over the Messaging channel, then this is expected behavior.  Messaging conversations are to the ticket as transcript blocks.  So the plain-text version of the ticket comment body will still be a "transcript" that contains the author and timestamp of the message.