Lazarus Freshdesk API (prod)

1. Tickets:

Get all tickets by some client platform code in period

/api/v1/tickets/get-tickets-in-period
curl --location 'https://freshcomm.cyberscp.com/api/v1/tickets/get-tickets-in-period?start_date=2024-09-01&end_date=2024-10-01' \
	--header 'Authorization: Bearer <platform-code-from-var-config[identifier_platform_report]>'

Response

{
    "code": 200,
    "status": "success",
    "message": "reporting-tr.get-client-tickets-in-period",
    "data": {
        "total": 15,
        "tickets": [
            {
              "id": 385500,
              "spam": false,
              "tags": [],
              "type": "Siniestro_Ciberseguridad",
              "due_by": "2024-11-01T20:42:14Z",
              "source": 3,
              "status": 3,
              "subject": "Siniestro de Ransonware - Expediente 20241029050 - NIT 804009 - SURTIMARCAS S.A.S.",
              "group_id": 14000072194,
              "priority": 1,
              "cc_emails": [
                  "helpdesk@lazarus.es"
              ],
              "fr_due_by": "2024-10-30T20:42:14Z",
              "nr_due_by": null,
              "to_emails": null,
              "company_id": 1400059633,
              "created_at": "2024-10-29T20:42:14Z",
              "fwd_emails": [],
              "product_id": 1400000952,
              "updated_at": "2024-10-29T21:32:50Z",
              "attachments": [],
              "description": "...html text...",
              "fr_escalated": false,
              "is_escalated": false,
              "nr_escalated": false,
              "requester_id": 1406633371,
              "responder_id": 1404972683,
              "custom_fields": {
                  "cf_poliza": "013000520524",
                  "cf_importe": null,
                  "cf_n_factura": null,
                  "cf_forense_pago": null,
                  "nmero_de_trabajo": null,
                  "cf_fecha_citacion": null,
                  "cf_forense_evento": null,
                  "cf_tipo_siniestro": "Ransomware",
                  "cf_fsm_contact_name": null,
                  "cf_fsm_phone_number": null,
                  "cf_fecha_ratificacin": null,
                  "cf_forense_tipologia": null,
                  "cf_n_trabajo_cliente": null,
                  "cf_fecha_de_asignacion": null,
                  "cf_forense_dispositivos": null,
                  "cf_fsm_service_location": null,
                  "cf_fsm_appointment_end_time": null,
                  "cf_fsm_appointment_start_time": null,
                  "cf_id_usuario": null
              },
              "support_email": null,
              "email_config_id": 14000044409,
              "reply_cc_emails": [
                  "helpdesk@lazarus.es"
              ],
              "association_type": 2,
              "description_text": "Expediente: 202410290501171 Nombre de la Empresa: SURTIMARCAS x.y.z CIF: (es la identificacion cedula o NIT): 8040090402 Persona a contactar: LUIS ...",
              "ticket_cc_emails": [],
              "source_additional_info": null,
              "associated_tickets_list": [
                  385497
              ]
            },
            {
                ...
            }
        ]
    }
}

1.1 Tickets by policy code

Get all tickets by policy code

/api/v1/tickets/get-tickets-by-policy-code/alpha-numeric-policy-code
curl --location 'https://freshcomm.cyberscp.com/api/v1/tickets/get-tickets-by-policy-code/900000942180' \
	--header 'Authorization: Bearer <platform-code-from-var-config[identifier_platform_report]>'

Response

{
    "code": 200,
    "status": "success",
    "message": "tickets-tr.get-client-tickets-by-policy-code",
    "data": {
        "client_uuid": "cli-d2f763a6-b52e-4f5c-93f1-b2174a36c6c4",
        "project_uuid": "prj-d743ac44-17a3-488a-a0ed-6e847cf10f82",
        "platform_code": "<platform-code-from-var-config[identifier_platform_report]>",
        "total": 8
        "tickets": [
            {
                "ticket_id": 368858,
                "policy_code": "code not found",
                "product_id": 14000009529,
                "product": "Project Name in our system",
                "source_id": 1,
                "source": "email",
                "status_id": 4,
                "status": "resolved",
                "subject": "Buenos días apreciados señores,\r\n\r\nEstamos en esepra de la respuesta a nuestra solicitud ...",
                "created_at": "2024-08-15T16:34:47Z",
                "updated_at": "2024-08-16T14:28:22Z"
            },
            ...
            {}
        ]
    }
}

1.2 Ticket by ticket number

Get full ticket detail including time entries and comments by ticket number. All attachments are links to download documents. These links are not permanent they have expiring time.

/api/v1/tickets/get-ticket-by-ticket-number/numeric-ticket-number
curl --location 'https://freshcomm.cyberscp.com/api/v1/tickets/get-ticket-by-ticket-number/325579' \
	--header 'Authorization: Bearer <platform-code-from-var-config[identifier_platform_report]>'

Response

{
    "code": 200,
    "status": "success",
    "message": "tickets-tr.get-ticket-by-ticket-number",
    "data": {
        "client_uuid": "cli-d2f763a6-b52e-4f5c-93f1-b2174a36c6c4",
        "project_uuid": "prj-d743ac44-17a3-488a-a0ed-6e847cf10f82",
        "platform_code": "xxx-yyyy20241119",
        "ticket": {
            "ticket_id": 418808,
            "policy_code": "code not found",
            "platform_user_id": null,
            "product_id": 14000009529,
            "product": "Project Name in our system",
            "requester_id": 14064961335,
            "requester": "Some requester Name ",
            "responder_id": 14065437880,
            "responder": "David R ",
            "source_id": 3,
            "source": "phone",
            "status_id": 4,
            "status": "resolved",
            "subject": "Llamada Entrante con +12345678 el Jue, Nov 28 a las 04:16:38 PM",
            "description": "Conversación entre +12345678  y Rafael Gonzales Nunes (+5512345678)",
            "created_at": "2024-11-28T15:17:34Z",
            "updated_at": "2024-11-28T15:18:06Z"
        },

        "time_entries": {
            "total": 58,
            "time_entries": [
                {
                    "time_entry_id": 14009152012,
                    "executed_at": "2024-07-30T00:00:00Z",
                    "support_by_id": 14065437880,
                    "support_by": "David Ramos",
                    "reason": "Sumadas las horas de julio",
                    "time_in_seconds": 7200
                },
                ...,
                {}
            ]
        },

        "conversations": {
            "total": 45,
            "conversations": [
                {
                    "conversation_id": 14242531071,
                    "created_at": "2024-04-30T19:01:52Z",
                    "updated_at": "2024-04-30T19:01:52Z",
                    "support_by_id": 14059776822,
                    "support_by": "Thomas Castro",
                    "support_email": "abc.cyber.co@abc.com, defg@hijk.com.co",
                    "content": "Buenas tardes, No será necesario, como lo menci...",
                    "attachments": [
                        {
                            "id": 14153439298,
                            "name": "Reporte de Seguimiento - TK431144  - SOME DOCUMENT- 17.01.2025.docx",
                            "content_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
                            "size": 43623,
                            "created_at": "2025-01-17T18:35:35Z",
                            "updated_at": "2025-01-17T18:35:49Z",
                            "attachment_url": "https://lazarustechnology.attachments10.freshdesk.com/data/helpdesk/attachments/production/12345678/original/some-doc-name-2017.01.2025.docx?Expires=1737975028&Signature=12345abcd45678ddeeff&Key-Pair-Id=APKAJ7JARUX3F6RQIXRA"
                        },
                        ...
                    ]
                },
                ...,
                {}
            ]
        }
    }
}

1.3 Ticket attachments

Tickets attachments are documents which belongs to emails sent to end user. These are links having AWS S3 urls with TTL. This means download links are valid for 5 minutes.

/api/v1/tickets/get-attachments-by-ticket-number/numeric-ticket-number
curl --location 'https://freshcomm.cyberscp.com/api/v1/tickets/get-attachments-by-ticket-number/431696' \
	--header 'Authorization: Bearer <platform-code-from-var-config[identifier_platform_report]>'

Response

{
    "code": 200,
    "status": "success",
    "message": "tickets-tr.get-attachments-by-ticket-number",
    "data": [
        {
            "id": 14153499647,
            "content_type": "application/octet-stream",
            "size": 19560,
            "name": "datos_llamada_entrante_call_center_policycode.docx",
            "attachment_url": "https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/14153499647/original/datos_llamada_entrante_call_center_policycode.docx?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAS6FNSMY2XLZULJPI%2F20250127%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250127T085315Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Signature=1111222333444555",
            "created_at": "2025-01-20T09:41:57Z",
            "updated_at": "2025-01-20T09:41:57Z"
        },
        ...,
        {
            "id": 14153499648,
            "content_type": "application/octet-stream",
            "size": 3067258,
            "name": "policycode.pdf",
            "attachment_url": "https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/14153499648/original/policycode.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAS6FNSMY2XLZULJPI%2F20250127%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250127T085315Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Signature=666777888999",
            "created_at": "2025-01-20T09:41:57Z",
            "updated_at": "2025-01-20T09:41:57Z"
        }
    ]
}

1.4 Get tickets statuses by tickets numbers (POST)

Tickets numbers should be sent as csv string. Like "tickets_numbers": "99383, 99382, 99381, ..."

/api/v1/tickets/get-tickets-statuses-by-tickets-numbers
curl --location 'https://freshcomm.cyberscp.com/api/v1/tickets/get-tickets-statuses-by-tickets-numbers' \
  --header 'Authorization: Bearer <platform-code-from-var-config[identifier_platform_report]>' \
  --data '{
    "tickets_numbers": "99383, 99382, 99381"
  }'

Response

{
    "code": 200,
    "status": "success",
    "message": "tickets-tr.tickets-status-by-tickets-numbers-retrieved",
    "data": {
        "client_uuid": "cli-d2f763a6-b52e-4f5c-93f1-b2174a36c6c4",
        "project_uuid": "prj-d743ac44-17a3-488a-a0ed-6e847cf10f82",
        "platform_code": "xxx-yyyy20241119",
        "tickets_statuses": [
            {
                "ticket_id": 99381,
                "status_id": 4,
                "status": "resolved"
            },
            {
                "ticket_id": 99382,
                "status_id": 4,
                "status": "resolved"
            },
            {
                "ticket_id": 99383,
                "status_id": 4,
                "status": "resolved"
            }
        ]
    }
}

1.5 Get ticket id by ticket number

Light weight endpoint to check if ticket exists in our system. Returns the same requested ticket number or null in case it does not exist

/api/v1/reporting/get-ticket-id-by-ticket-number/numeric-ticket-number
curl --location 'https://freshcomm.cyberscp.com/api/v1/reporting/get-ticket-id-by-ticket-number/423463' \
	--header 'Authorization: Bearer <platform-code-from-var-config[identifier_platform_report]>'

Response

{
    "code": 200,
    "status": "success",
    "message": "tickets-tr.get-ticket-by-ticket-number",
    "data": {
        "ticket_id": 423463
    }
}

2. Reporting:

2.1 Total tickets by channel support

Get total tickets by channel support in period

/api/v1/reporting/kpis/get-total-tickets-by-channel-support
curl --location 'https://freshcomm.cyberscp.com/api/v1/reporting/kpis/get-total-tickets-by-channel-support?start_date=2024-09-01&end_date=2024-10-01' \
	--header 'Authorization: Bearer <platform-code-from-var-config[identifier_platform_report]>'

Response

{
    "code": 200,
    "status": "success",
    "message": "reporting-tr.get-kpi-total-tickets-by-channel-support",
    "data": {
        "platform_code": "<platform-code-from-var-config[identifier_platform_report]>",
        "kpi": {
            "chat": 12,
            "portal": 2,
            "email": 1,
            "total": 15
        }
    }
}

2.2 Time spent by ticket

Get total time spent by ticket in period

/api/v1/reporting/kpis/get-time-spent-by-ticket
curl --location 'https://freshcomm.cyberscp.com/api/v1/reporting/kpis/get-time-spent-by-ticket?start_date=2024-09-01&end_date=2024-10-01' \
	--header 'Authorization: Bearer <platform-code-from-var-config[identifier_platform_report]>'

Response

{
    "code": 200,
    "status": "success",
    "message": "reporting-tr.get-time-spent-by-ticket",
    "data": {
        "totals": {
            "Marzo": "05:33",
            "Total horas": "05:33"
        },
        "time_entries": [
            {
                "projectName": "Some project name of security",
                "policyCode": "PZA1234567",
                "ticketId": 320232,
                "timeEntryId": 14008330374,
                "ticketStatus": "Resolved",
                "ticketExecutedAt": "19/03/2024 01:00",
                "supportBy": "Tim De Blas",
                "ticketReason": "Llamada apertura siniestro",
                "ticketTime": "00:28",
                "ticketTimeSeconds": 1680,
                "ticketDate": "19/03/2024"
            },
            {
                "projectName": "Some project name of security",
                "policyCode": "PZA1234567",
                "ticketId": 320232,
                "timeEntryId": 14008330384,
                "ticketStatus": "Resolved",
                "ticketExecutedAt": "19/03/2024 01:00",
                "supportBy": "Tim De Blas",
                "ticketReason": "Correo con medidas contención y solicitud evidencias",
                "ticketTime": "00:30",
                "ticketTimeSeconds": 1800,
                "ticketDate": "19/03/2024"
            }
            ...
        ]
    }
}

2.3 Time spent by ticket with ticket type, damage and group

Get total time spent by ticket in period

/api/v1/reporting/kpis/get-time-spent-by-ticket-with-group
curl --location 'https://freshcomm.cyberscp.com/api/v1/reporting/kpis/get-time-spent-by-ticket-with-group?time_zone=America/Bogota&start_date=2024-09-01&end_date=2024-10-01' \
	--header 'Authorization: Bearer <platform-code-from-var-config[identifier_platform_report]>'

Response

{
    "code": 200,
    "status": "success",
    "message": "reporting-tr.reporting-tr.get-time-tickets-with-group",
    "data": {
        "totals": {
            "Marzo": "05:33",
            "Total horas": "05:33"
        },
        "time_entries": [
            {
                "project": "Some project name in our system",
                "policy_code": "90000104660",
                "ticket_id": 294377,
                "type": "Ransomware",
                "damage_type": "",
                "group": "Operadores Ciberseguridad",
                "status": "Resolved",
                "time_entry_id": 14009027940,
                "time_reason": "Email a la Aseguradora - Reporte de avance de Siniestro",
                "time_support_by": "Rafael R. O.",
                "time_executed_at": "10/01/2024 19:00",
                "time_date_executed_at": "10/01/2024",
                "time_in_seconds": 3600,
                "time_hours": "01:00"
            },
            {
                "project": "Some project name in our system",
                "policy_code": "900010466940",
                "ticket_id": 294378,
                "type": "Ransomware",
                "damage_type": "Factura devuelta",
                "group": "Operadores Ciberseguridad",
                "status": "Resolved",
                "time_entry_id": 1400902794,
                "time_reason": "Email a la Aseguradora - Reporte de avance de Siniestro",
                "time_support_by": "Rafael L L",
                "time_executed_at": "10/01/2024 19:00",
                "time_date_executed_at": "10/01/2025",
                "time_in_seconds": 1800,
                "time_hours": "00:30"
            },
            ...
        ]
    }
}

2.4 Get ticket detail with time-entries and public conversations its attachments and calls

Get ticket detail by ticket number for reporting

/api/v1/reporting/get-ticket-detail-by-ticket-number/431696
curl --location 'https://freshcomm.cyberscp.com/api/v1/reporting/get-ticket-detail-by-ticket-number/431696' \
	--header 'Authorization: Bearer <platform-code-from-var-config[identifier_platform_report]>'

Response

{
    "code": 200,
    "status": "success",
    "message": "reporting-tr.get-report-ticket-detail-by-ticket-number",
    "data": {
        "client_uuid": "cli-64a29c82-972e-4e35-9a6e-9409dc614rr",
        "project_uuid": "prj-64a29c82-972e-4e35-9a6e-9409dc61acd",
        "platform_code": "clientplat-TCP20241018",

        "ticket": {
            "ticket_id": 431696,
            "policy_code": "",
            "requester_id": 14061781599,
            "requester": "Sr. Luis XXX xxxx@clientdomain.com",
            "responder_id": 14051682574,
            "responder": "Jesus Muñoz jmarin@lazarus.es",
            "source": "email",
            "status": "closed",
            "type": "",
            "subject": "RV: Nuevo Siniestro - Empresa: XXX - N Póliza: POLICY CODE - N siniestro: 49427",
            "description": "Buenas tardes equipo Lazarus,\r\n\r\n¿Os ha proporcionado la denuncia el Asegurado?\r\nQuedamos a la espera.\r\n\r\nMuchas...",
            "created_at": "2025-02-06T17:46:02Z",
            "updated_at": "2025-02-07T13:46:54Z",
            "secondary_tickets": [
                433934,
                434757,
                436859,
                438978
            ],
            "attachments": [
                {
                    "id": 14154452177,
                    "name": "cen650729.docx",
                    "attachment_url": "https://cache.lazarustechservices.com/pro-14000002737-978b78732431b47917a9fab8d54b7fc7/436990/ticket/14154452177-b16c8954a40538d74c7d3a08ef40b471.docx",
                    "created_at": "2025-02-06T17:46:02Z"
                }
            ]
        },
        "time_entries": {
            {
                "time_entry_id": 14010441136,
                "ticket_id": 434422,
                "created_at": "2025-02-13T08:54:14Z",
                "support_by": "Sebastián Celoria",
                "reason": "Cierre del Ticket",
                "time_in_seconds": 1800
            }
        },
        "conversations": [
            {
                "conversation_id": 14262533656,
                "created_at": "2025-02-07T09:11:01Z",
                "support_by": "agent: 14061781599",
                "content": "Buenos días Sr. Velayos,\r\nTal ....",
                "attachments": []
            },
            {
                "conversation_id": 14262499699,
                "created_at": "2025-02-06T19:25:19Z",
                "support_by": "Giorgio Altina",
                "content": "Buenas tardes Luis,  adjunto la denuncia.  ..  ejercer sus derechos de acceso, rectificación y cancelación, ...   ",
                "attachments": [
                    {
                        "id": 14154456117,
                        "name": "denuncia-file.pdf",
                        "attachment_url": "https://cache.lazarustechservices.com/pro-14000002737-978b78732431b47917a9fab8d54b7fc7/436990/conversation/14154456117-dba7d0664370f46a310760ed59d6e777.pdf",
                        "created_at": "2025-02-06T19:04:35Z"
                    }
                ]
            }
        ],
        "calls": [
            {
                "call_id": 121282858,
                "direction": "outgoing",
                "note": "Realizamos llamada para conectarnos a la red del afectado con el ransomware",
                "support_by_id": 531812,
                "support_by": "Daniel Patiño",
                "customers": [
                    "+34123456789"
                ],
                "created_at": "2022-02-16T16:25:41Z",
                "updated_at": "2022-02-16T16:35:38Z"
            },
            ...
            {
                "call_id": 120774454,
                "direction": "incoming",
                "note": "Se cuelga la llamada",
                "support_by_id": 531812,
                "support_by": "Daniel Patiño",
                "customers": [
                    "+34675432100"
                ],
                "created_at": "2022-02-14T11:45:35Z",
                "updated_at": "2022-02-14T11:52:28Z"
            }
        ]
    }
}

2.5 Get tickets by filters

Filters: start_date, end_date and/or policy_code
At least one filter (dates or policy code) should be provided.

/api/v1/reporting/get-tickets-by-filters ?start_date=2024-01-01&end_date=2024-01-31&policy_code=010231457
curl --location 'https://freshcomm.cyberscp.com/api/v1/reporting/get-tickets-by-filters?start_date=2024-01-01&end_date=2024-01-31&policy_code=010231457' \
	--header 'Authorization: Bearer <platform-code-from-var-config[identifier_platform_report]>'

Response

{
    "code": 200,
    "status": "success",
    "message": "reporting-tr.get-tickets-by-filters",
    "data": {
        "client_uuid": "cli-2db392fb-516b-4289-ab28-2693a90f286d",
        "project_uuid": "prj-a218547d-4f52-4801-a226-955264f3fa00",
        "platform_code": "clientplat-TCP20241018",
        "total": 6042,
        "tickets": [
            {
                "ticket_id": 299691,
                "type": "Suplantacion identidad",
                "policy_code": "010231457",
                "subject": "Siniestro Suplantación SOME COMPANY NAME - Póliza CP0231457 - TK 299691 - Aseguradora SOME INSURANCE...",
                "requester_id": 14062641042,
                "requester": 14062641042,
                "responder_id": 14056316574,
                "responder": "Giorgio xxx@lazarus.es",
                "status_id": 4,
                "status": "resolved",
                "source_id": 3,
                "source": "phone",
                "created_at": "2024-01-03T10:14:38Z",
                "updated_at": "2024-01-24T14:41:05Z"
            },
            ...
            {
                ...
            }
        ]
    }
}