Recent searches


No recent searches

[Zendesk API] Adding private comment to the ticket with text and link



Posted Mar 25, 2022

Hello,

I am testing adding the private comment to the ticket via Zendesk API. Any documentation on how to add a mixture of text and URL link (via html tag)?

I tried using `<a href=<url>><text></a>` but it doesn't render as a hyperlink. Any help would be appreciated.

Thanks!


0

5

5 comments

image avatar

Andrew J

Community Moderator

API reference: https://developer.zendesk.com/api-reference/help_center/help-center-api/post_comments/#create-post-comment

Should be able to use html.  Can you post your actual code?

Or you could try markdown 

Syntax:   [Link display text](http://www.sampleurl.com)

-1


The API reference that you are referring to is the "Post comment" to a community post and not to a ticket.

I am referring to a customer submitting a ticket through the webform or by other channels and then I would use Zendesk API to surface a private comment on the ticket for our agent's reference.

This is what I am referring to: [Link](https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_comments/)

Does that make sense? Thanks in advance!

0


Markdown works perfectly. Thanks!

0


Mario Wijaya - were you able to resolve? I'm trying to do the same thing, but not sure which API call to make. 

0


image avatar

Tipene Hughes

Zendesk Developer Advocacy

Hey Chris,
 
You can make a call to the Tickets API similarly to how you would to add a normal comment, but instead of the body property, you'll use the html_body property. Here's an example of how that might look in practice:
 
{
"ticket": {
"comment": {
"html_body": "<a href='https://www.example.com'>This is a link</a>",
"public": false
}
}
}
 
I hope this helps! Let me know if you have any questions. 
 
Tipene

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post