When querying the API with, as an example:
% curl --header "Content-Type: application/json" \
--header "Authorization: Token token=xyz" \
--request GET http://localhost:8080/api/v1/ticket_articles/by_ticket/97
I get a list of articles that is as follows:
[
{
"id": 102,
"ticket_id": 97,
"type_id": 10,
"sender_id": 1,
"from": "Luca Ferrari",
"to": null,
"cc": null,
"subject": "TEST CON APPEND",
"reply_to": null,
"message_id": null,
"message_id_md5": null,
"in_reply_to": null,
"content_type": "text/plain",
"references": null,
"body": "Messaggio utente",
"internal": false,
"preferences": {},
"updated_by_id": 3,
"created_by_id": 3,
"origin_by_id": null,
"created_at": "2024-06-05T07:45:48.854Z",
"updated_at": "2024-06-05T07:45:48.854Z",
"attachments": [],
"created_by": "luca@me.com",
"updated_by": "luca@me.com",
"type": "note",
"sender": "Agent",
"time_unit": null
},
{
"id": 103,
"ticket_id": 97,
"type_id": 10,
"sender_id": 1,
"from": "Luca Ferrari",
"to": "",
"cc": "",
"subject": "",
"reply_to": null,
"message_id": null,
"message_id_md5": null,
"in_reply_to": "",
"content_type": "text/html",
"references": null,
"body": "messaggio privato<br>",
"internal": true,
"preferences": {},
"updated_by_id": 3,
"created_by_id": 3,
"origin_by_id": null,
"created_at": "2024-06-05T07:46:07.119Z",
"updated_at": "2024-06-05T07:46:07.119Z",
"attachments": [],
"created_by": "luca@me.com",
"updated_by": "luca@me.com",
"type": "note",
"sender": "Agent",
"time_unit": null
},
{
"id": 104,
"ticket_id": 97,
"type_id": 10,
"sender_id": 1,
"from": "Luca Ferrari",
"to": "",
"cc": "",
"subject": "",
"reply_to": null,
"message_id": null,
"message_id_md5": null,
"in_reply_to": "",
"content_type": "text/html",
"references": null,
"body": "risposta pubblica 1<br>",
"internal": false,
"preferences": {},
"updated_by_id": 3,
"created_by_id": 3,
"origin_by_id": null,
"created_at": "2024-06-05T07:46:17.077Z",
"updated_at": "2024-06-05T07:46:17.077Z",
"attachments": [],
"created_by": "luca@me.com",
"updated_by": "luca@me.com",
"type": "note",
"sender": "Agent",
"time_unit": null
},
{
"id": 105,
"ticket_id": 97,
"type_id": 10,
"sender_id": 1,
"from": "Luca Ferrari",
"to": "",
"cc": "",
"subject": "",
"reply_to": null,
"message_id": null,
"message_id_md5": null,
"in_reply_to": "",
"content_type": "text/html",
"references": null,
"body": "risposta privata 2<br>",
"internal": true,
"preferences": {},
"updated_by_id": 3,
"created_by_id": 3,
"origin_by_id": null,
"created_at": "2024-06-05T07:46:23.661Z",
"updated_at": "2024-06-05T07:46:23.661Z",
"attachments": [],
"created_by": "luca@me.com",
"updated_by": "luca@me.com",
"type": "note",
"sender": "Agent",
"time_unit": null
},
{
"id": 106,
"ticket_id": 97,
"type_id": 10,
"sender_id": 1,
"from": "Luca Ferrari",
"to": "",
"cc": "",
"subject": "",
"reply_to": null,
"message_id": null,
"message_id_md5": null,
"in_reply_to": "",
"content_type": "text/html",
"references": null,
"body": "messaggio pubblico 2<br>",
"internal": false,
"preferences": {},
"updated_by_id": 3,
"created_by_id": 3,
"origin_by_id": null,
"created_at": "2024-06-05T07:46:32.991Z",
"updated_at": "2024-06-05T07:46:32.991Z",
"attachments": [],
"created_by": "luca@me.com",
"updated_by": "luca@me.com",
"type": "note",
"sender": "Agent",
"time_unit": null
}
Is there a safe way to identify the article that generated the ticket, i.e., the very first article, other than getting the article with the lowest id
? ``