Webhooks - How do i get content from a native_messaging(75) comment? | Community
Skip to main content

Webhooks - How do i get content from a native_messaging(75) comment?

  • March 26, 2024
  • 3 replies
  • 0 views

Hello!

 

I am using the webhooks to get comments from my users, but a new one started using it and my webhooks are not working for them.

 

After some time, I noticed that, unlike the other users, they use the native zendesk chat, and the source id from this chat is 75, aka native_messaging.

 

All messages from this source return me something like this: "Conversa com 'User' \\n\\nURL: None\". Is there any field i could add to the webhook to get the actual message? I have tried using "ticket.latest_comment", "ticket.latest_comment_formatted", "ticket.latest_comment_rich" and even "ticket.comments" and all of them return me only the previous string.

3 replies

Tipene
  • March 29, 2024
Hey there,
 
Messaging comments are not available via the Ticket Comments endpoint, unfortunately. An alternative option would be to use the Ticket Audits endpoint, where you will find records of comments made via messaging as well as other channels. Here's a link to the documentation which goes in to more detail:
 
Ticket Audits API docs
Which API can I use for messaging?
 
Feel free to reach out with any questions!
 
Tipene

  • Author
  • April 3, 2024

Hello, thank you for your response!

 

I'm not sure if we're discussing different endpoints, but I'm already receiving messages from the messaging with the webhooks, so I don't think it's an endpoint problem.

 

I don't understand why, but with only this new one, the text doesn't come through. I really want to avoid using the API since it could increase costs for my clients, but the webhook just isn't returning the text.

 

For example, from other companies, the text I receive from the chat looks something like this:

“ (00:00:00) End-user: Hello! (00:00:00)  Agent: Hi, how could I help? …….” .

 

Any ideia on why?


  • Author
  • April 3, 2024

Ok, I've decided to try the audit API call in both cases to find the difference. The main distinction is that sometimes Zendesk creates a comment for the chat, and sometimes it doesn't. Do you know if it's triggered by something, or is it internal?

 

Example of the audit:

{

                    "id": idnumber,

                    "type": "ChatEndedEvent",

                    "value": {

                        "chat_id": "chatid",

                        "chat_started_event_id": chatstartedid,

                        "visitor_id": "visitorid",

                        "is_served": true

                    },

                    "attachments": []

                },

                {

                    "id": commentid,

                    "type": "Comment",

                    "author_id": -1,

                    "body": "(15: 07: 48) name: Hi there. How can I help you today?\n(15: 07: 50) name: \n(15: 07: 54) Web User stringnumber: Name: novo\n(15: 07: 56) name: Connecting you with someone now.\n(15: 08: 01) novo: ok\n(15: 08: 14) name name: hi!\n(15: 08: 17) novo: hello\n(15: 08: 22) novo: this is a test?\n(15: 08: 25) name name: it is\n(15: 08: 27) name name: thanks",

                    "html_body": "",

                    "plain_body": "(15: 07: 48) name : Hi there. How can I help you today?\n\n(15: 07: 50) name : \n\n(15: 07: 54) Web User stringnumber: Name: novo\n\n(15: 07: 56) name: Connecting you with someone now.\n\n(15: 08: 01) novo: ok\n\n(15: 08: 14) name name: hi!\n\n(15: 08: 17) novo: hello\n\n(15: 08: 22) novo: this is a test?\n\n(15: 08: 25) name name : it is\n\n(15: 08: 27) name name : thanks",

                    "public": true,

                    "attachments": [],

                    "audit_id": auditid

                }

 

 

And this happened to everyone, but not to the new client.