Create a message
Changed onCreate a message and either:
- not send it if the attribute sent_datetime is filled. If you import a message that was already sent, make sure to set this value.
- send it to the recipients if the attribute sent_datetime is empty.
- add it to the ticket as an internal note if you specified this channel. Internal notes are not sent to your customers.
When a message is created, it does not mean that this one has been sent because the creation and sending process are decoupled. Messages are basically sent asynchronously. Once a message has been sent, Gorgias will automatically update the message to fill the time when it was sent (sent_datetime).
Request
- Base URLhttps://your-domain.gorgias.com
- AuthHTTP basic
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
The ID of the ticket to create a message in.
Query parameters
Policy applied on external actions associated with the message if they failed. Three actions are possible:
- force: bypass the failed action and try to execute the remaining one and to send the message
- retry: retry the failed action
- cancel: delete the TicketMessage
Headers
An HTTP-date precondition for message creation. For a merged source ticket, this returns ticket_merged only when the ticket was merged after the supplied time, compared at one-second resolution. Invalid dates are ignored. A satisfied or ignored condition does not make a merged ticket available, so normal 404 behavior still applies.
Request body
Response
The created message.
Example response
{
"id": 924712,
"message_id": "<123345676453.2445.234@web>",
"ticket_id": 12,
"external_id": "MSG-78545",
"public": true,
"integration_id": 28643,
"intents": [
{
"name": "discount/request"
}
],
"rule_id": 89465,
"from_agent": true,
"subject": "Re:Refund request",
"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 ",
"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 ",
"attachments": [],
"macros": [],
"actions": [],
"headers": {
"My-Header": "foo"
},
"meta": {},
"created_datetime": "2020-01-27T10:42:21.468912",
"processed_datetime": "2020-01-27T10:42:21.468912",
"deleted_datetime": "2020-01-27T10:42:21.468912",
"opened_datetime": "2019-07-05T15:22:46.472436",
"replied_by": {
"integration_id": 28643,
"created_datetime": "2020-01-27T10:42:21.468912",
"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 "
},
"replied_to": {
"integration_id": 28643,
"created_datetime": "2020-01-27T10:42:21.468912",
"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 "
}
}Changes
- info
added the new optional
headerrequest parameterIf-Unmodified-Since - info
added the non-success response with the status
- info
added the required property
to the response with the status
- info