# Conversation attachments

Conversation attachments are files attached to specific interactions in a conversation.

Allowed file types:

jpg, jpeg, png, gif, pdf, zip, html, txt, gzip, svg, csv, sql, db, sqlite, doc, docx, docm, dot, md, css, xml, xhtml, gdoc, js, json, xlsx

TIP

Fingerprint authentication is supported in this endpoint.

# The attachment object

  • id integer

    The system-generated ID of the attachment.

  • conversation_interactin_id integer

    The ID of the interaction the attachments belongs to.

  • filename string

    The name of the file attached.

  • size integer

    The size of the attached file in bytes.

  • size_human string

    The size of the attached file in a human readable format. E.g., 1 KB for 1 kilobyte.

  • url string

    The URL of the file for download or online viewing. For the user to view or download the file attachment, he or she needs to be logged in and have access to the account.

# The attachment object

{
  "id": 1,
  "conversation_interaction_id": 1,
  "filename": "screenshot.jpeg",
  "size": 1024,
  "size_human": "1 KB",
  "url": "https://www.yourdomain.com/storage/attachments/1/1/1/10000001.jpeg",
  "is_inline": true
}

# Create an attachment

  • file file

    The file to upload.

  • is_inline boolean

    Whether the file is inline or not.

# Sample request

curl https://www.yourdomain.com/api/v1/accounts/1/conversations/1/interactions/1/attachments \
  --request POST \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <access-token>" \
  -F "file=@/home/me/Desktop/image.jpeg" \ 
  -F is_inline=true

# Sample successful response

{
  "data": {
    "id": 1,
    "conversation_interaction_id": 1,
    "filename": "image.jpeg",
    "size": 1024,
    "size_human": "1 KB",
    "url": "https://www.yourdomain.com/storage/attachments/1/1/1/10000001.jpeg",
    "is_inline": true
  }
}

# Retrieve a conversation

# Sample request

curl https://www.yourdomain.com/api/v1/accounts/1/conversations/1/interactions/1/attachments/1 \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <access-token>" \
  -G

# Sample successful response

{
  "data": {
    "id": 1,
    "conversation_interaction_id": 1,
    "filename": "image.jpeg",
    "size": 1024,
    "size_human": "1 KB",
    "url": "https://www.yourdomain.com/storage/attachments/1/1/1/10000001.jpeg",
    "is_inline": true
  }
}

# List all attachments

# Sample request

curl https://www.yourdomain.com/api/v1/accounts/1/conversations/1/interactions/1/attachments \
  -G \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <access-token>"

# Sample successful response

{
  "data": [
    {
      "id": 1,
      "conversation_interaction_id": 1,
      "filename": "image.jpeg",
      "size": 1024,
      "size_human": "1 KB",
      "url": "https://www.yourdomain.com/storage/attachments/1/1/1/10000001.jpeg",
      "is_inline": true
    },
    {...}
  ]
}