The TicketMessage object

A ticket-message represents a message (an email, an SMS, a Facebook comment, chat message, etc..) under a normalized format.
There are 3 types of messages:

  • Outgoing messages: messages sent by your company (by rules or support agents) to your customers.
  • Incoming messages: messages sent by your customers to your company.
  • Internal notes: internal messages sent between support agents (users). Internal notes are not sent/shared with your customers.

A ticket-message is associated with only one ticket.

TicketMessage properties

integer

ID of the message.

array

A list of files attached to the message.

string

The full HTML version of the body of the message, if any.

string

The full text version of the body of the message, if any.

string

The channel used to send the message.

ISO 8601 datetime

When the message was created.

string

ID of the message in a foreign system (Aircall, Zendesk, etc...). This field is not used by Gorgias, feel free to set it as you wish.

ISO 8601 datetime

When the message failed to be sent. Messages that couldn't be sent can be resend.

boolean

Whether the message was sent by your company to a customer, or the opposite.

integer

ID of the integration that either received or sent the message.

None

Details of the last error encountered when Gorgias attempted to send the message.

string

ID of the message on the service that send the message.It can be the ID of an email, a Messenger message, a Facebook comment, etc...

object

The primary receiver of the message. It can be a user or a customer. Optional when the source type is "internal-note".

integer

ID of the rule which sent the message, if any.

object

The person who sent the message. It can be a user or a customer.

ISO 8601 datetime

When the message was sent. If ommited, the message will be sent by Gorgias.

object

Information used to route the message. It contains the names and the addresses of the sender and receivers.

string

The HTML version of the body of the message without email signatures and previous replies.

string

The text version of the body of the message without email signatures and previous replies.

string

The subject of the message.

integer

The ID of the ticket the message is associated with.

string

How the message has been received, or sent from Gorgias.

string

URI of the message.

TicketMessage example object

{
  "id": 924712,
  "attachments": [],
  "body_html": "Hello,<br><br>\n\n        I can't place an order on your site, it says: I don't have enough credit.<br>\n        How can I add some credits?<br><br>\n\n        Cheers,<br>\n        John Doe\n        ",
  "body_text": "Hello,\n\n        I can't place an order on your site, it says: I don't have enough credit.\n        How can I add some credits?\n\n        Cheers,\n        John Doe\n        ",
  "channel": "email",
  "created_datetime": "2020-01-27T10:42:21.468912",
  "external_id": "MSG-78545",
  "failed_datetime": null,
  "from_agent": true,
  "integration_id": 28643,
  "last_sending_error": null,
  "message_id": "<123345676453.2445.234@web>",
  "receiver": {
    "id": 8
  },
  "rule_id": 89465,
  "sender": {
    "id": 7
  },
  "source": {
    "type": "email",
    "from": {
      "id": 7,
      "name": "Sender Doe",
      "address": "[email protected]"
    },
    "to": [
      {
        "id": 8,
        "name": "Receiver Doe",
        "address": "[email protected]"
      }
    ]
  },
  "stripped_html": null,
  "stripped_text": null,
  "subject": "Re:Refund request",
  "ticket_id": 12,
  "via": "api",
  "uri": "/api/tickets/12/messages/924712/"
}