Skip to main content

Tickets

This API enables the listing, creation, and management of tickets on Osana's platform, integrated with the customer's CRM.

GET /ticket_types

Returns all ticket types supported by the organization, including the fields required for each type.

Response:

Code 200
[
{
"id": "9685c4b5-f25d-4adf-b821-2996f0e05ebe",
"created_at": "2024-01-01T12:00:00Z",
"updated_at": "2024-09-05T09:30:00Z",
"status": "active",
"title":"Claim",
"description": "Patient insurance claim procedure",
"fields": [
{
"id": "be41ffc0-36f1-497a-9df6-554338877f7b"
"type": "string",
"tooltip": "Enter the patient name",
"validationRegex": "^[A-Za-z ]+$"
},
{
"id": "7d268cef-84a0-42bf-8092-53841a9a90fe"
"type": "date",
"tooltip": "Enter the date of claim",
"validationRegex": "^\\d{4}-\\d{2}-\\d{2}$"
}
]
}
]

GET /patients/{id}/ticket/

Returns all tickets for a patient.

URI Parameters

  • id: Patient's ID

Query Parameters

  • start_date(optional): parameter used to filter tickets by start date(formatted as "yyyy-mm-dd").
  • end_date(optional): parameter used to filter tickets by end date(formatted as "yyyy-mm-dd").
  • ticket_type_id(optional): parameter used to filter tickets by type (string)
  • status(optional): Status of the procedure (string)

Response:

Code 200
[
{
"uid": "8b82d37a-8613-46f0-b6d4-b61c31ad6643",
"createdAt": "2024-01-15T12:00:00Z",
"updatedAt": "2024-09-01T08:30:00Z",
"status": "completed",
"ticket_type_id": "9685c4b5-f25d-4adf-b821-2996f0e05ebe",
"observations": "Procedure approved.",
"fields": [
{
"id":"66ea3050-dcbb-4747-af0d-622d5fdd6904",
"dataType": "string",
"value": "John",
"tooltip": "First name"
},
{
"id":"1be40ef2-8ab2-4569-b012-4ea0fdd2f45c",
"dataType": "file",
"value": "binary file",
"tooltip": ""
}
]
}
]

POST /patients/{id}/ticket_type/{ticket_type_id}/ticket

Endpoint used to register a ticket.

URI Parameters

  • id: Patient's ID
  • ticket_type_id: ticket type id
Body
Body:
{
"observations": "string",
"fields": [
{
"id":"be41ffc0-36f1-497a-9df6-554338877f7b",
"value": "John"
},
{
"id":"7d268cef-84a0-42bf-8092-53841a9a90fe",
"value": "25/09/2023"
}
]
}

Response:

Code 201
 {}