TicketMessage
A ticket message represents one message from the conversation. A ticket message belongs to a ticket.
- GET All messages
- GET Number of messages
- GET Retrieve a message
- POST Create a message
- PUT Update a message
- DELETE Delete a message
Example Object
{
"ticketMessage": {
"id": 20337,
"createdAt": "2019-08-07T19:04:03+00:00",
"updatedAt": null,
"from": "customer",
"message": "Ticket Message"
}
}
Properties
id | The unique numeric identifier for the ticket message. {“id”: “{id}”} |
createdAt | The date and time when the ticket message was created. (format: ISO-8601){“createdAt”: “2019-08-07T19:04:03+00:00”} |
updatedAt | The date and time when the ticket message was last updated. (format: ISO-8601){“updatedAt”: “2019-08-07T19:04:03+00:00”} |
from | The author of the message. This defaults to the shop. {“from”: “customer|shop”} |
message | The content of the message. {“message”: “Ticket Message”} |
GET All messages
Retrieve a list of all ticketMessage objects from a specific ticket.
Definition
GET /tickets/{ticket_id}/messages.json
Example request
curl https://api.shoplightspeed.com/en/tickets/{ticket_id}/messages.json \
-u {key}:{secret}
<?php $api->ticketsMessages->get($ticket_id);
Example Response
{
"ticketMessages": [
{
"id": 20337,
"createdAt": "2019-08-07T19:04:03+00:00",
"updatedAt": null,
"from": "customer",
"message": "Ticket Message"
}
]
}
Arguments
No arguments available. |
GET Number of messages
Retrieve the total number of ticketMessage objects from a specific ticket.
Example request
curl https://api.shoplightspeed.com/en/tickets/{ticket_id}/messages/count.json \
-u {key}:{secret}
<?php $api->ticketMessages->count($ticket_id);
Example response
{
"count": 1
}
Arguments
No arguments available. |
GET Retrieve a message
Retrieve a single ticketMessage based on the unique identifier.
Definition
GET /tickets/{ticket_id}/messages/{ticketMessage_id}.json
curl https://api.shoplightspeed.com/en/tickets/{ticket_id}/messages/{ticketMessage_id}.json \
-u {key}:{secret}
<?php $api->ticketMessages->($ticket_id , $ticketMessage_id);
Example Response
{
"ticketMessages": [
{
"id": 20337,
"createdAt": "2019-08-07T19:04:03+00:00",
"updatedAt": null,
"from": "customer",
"message": "Ticket Message"
}
]
}
Arguments
id | The unique numeric identifier for the ticket message. {“id”: {id}} |
POST Create a message
Create a new ticketMessage based on the given parameters.
Definition
POST /tickets/{ticket_id}/messages.json
Example Request
curl -X POST https://api.shoplightspeed.com/en/tickets/{ticket_id}/messages.json \
-u {key}:{secret}
-d ticketMessage[from]="shop" \
-d ticketMessage[message]="Test TicketMessage" \
<?php $api->ticketMessages->create([
"from" => "shop",
"message" => "Test TicketMessage"
]);
Example Json payload
{
"ticketMessage" :
{
"from" : "shop",
"message" : "Test TicketMessage"
}
}
Example Response
{
"ticketMessage": {
"id": 20338,
"createdAt": "2019-08-07T19:07:27+00:00",
"updatedAt": "2019-08-07T19:07:27+00:00",
"from": "shop",
"message": "Test TicketMessage"
}
}
Arguments
from | The author of the message. {“from”: “customer|shop” } |
message | The content of the message. {“message”: “Test TicketMessage”} |
PUT Update a message
Update an existing ticketMessage based on the given parameters.
Definition
PUT /tickets/{ticket_id}/messages/{ticketMessage_id}.json
Example request
curl -X PUT https://api.shoplightspeed.com/en/tickets/{ticket_id}/messages/{ticketMessage_id}.json \
-u {key}:{secret} \
-d ticketMessage[from]="shop" \
-d ticketMessage[message]="Test Ticketmessage update"
<?php $api->ticketMessages->create([
"from" => "shop",
"message" => "Test Ticketmessage update"
Example Json payload
{
"ticketMessage" :
{
"from" : "shop",
"message" : "Test Ticketmessage update"
}
}
Example response
{
"ticketMessage": {
"id": 20338,
"createdAt": "2019-08-07T19:07:27+00:00",
"updatedAt": "2019-08-07T19:09:37+00:00",
"from": "shop",
"message": "Test Ticketmessage update"
}
}
Arguments
from | The author of the message. This defaults to the shop. {“from”: “customer|shop”} |
message | The content of the message {“message”: “Test TicketMessage”} |
DELETE Delete a message
Delete an existing ticket message based on the unique identifier.
Definition
DELETE /tickets/{ticket_id}/messages/{ticketMessage_id}.json
Example request
curl -X DELETE https://api.shoplightspeed.com/en/tickets/{ticket_id}/messages/{ticketMessage_id}.json\
-u {key}:{secret}
<?php $api->ticketMessages->delete($ticket_id , $ticketMessage_id);
Example Response
HTTP/1.1 204 No Content
Arguments
id | The unique numeric identifier for the ticket message. {“id”: {id}} |