API to get attachments related to Ticket or Ticket Conversations

Hi Team,

How to get attachments related to Ticket or Ticket Conversations using Freshdesk API ?

Kindly help with API details.

1 Like

Hi Haritha,

For ticket:

/api/v2/tickets/{id}

For conversations:

/api/v2/tickets/{id}/conversations

Both the main ticket details and the conversations will have an attachments array if there are any attachments present. This array will have links to the actual files. These links typically expire after a certain amount of time for security reasons, so it’s ideal to download them when you need them.

Another API request that allows you to retrieve ticket and conversation information together is this:

/api/v2/tickets/{id}?include=conversations

Response example:

{
  ...
  "attachments": [],
  ...
  "conversations": [
    {
      ...
      "attachments": [
        {
          "id": 123432...,
          "name": "example.csv",
          "content_type": "application/octet-stream",
          "size": 9376,
          "created_at": "2022-12-29T16:06:11Z",
          "updated_at": "2022-12-29T16:06:11Z",
          "attachment_url": "..."
        }
      ],
      ...
    },
    {
      ...
    }
  ],
  ...
}

Hope this helps!

3 Likes

Hi @Mattia_Piparo ,

Also is there a way to retrieve inline images via API ?

Ex: There may be some freshdesk logo or other inline images in tickets or conversations, how to retrieve those inline images via API ?

Kindly help

As far as I know, I fear that the only possibility is to extract them from the html description.

1 Like

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.