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


  • 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)

  • Mario Wijaya

    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!

  • Mario Wijaya

    Markdown works perfectly. Thanks!

  • Chris Green

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

  • 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. 

Please sign in to leave a comment.

Powered by Zendesk