### Resource Path Example Source: https://api.totvs.com.br/guia Provides examples of resource paths, showing how to represent collections and individual items using IDs. ```http /beers ``` ```http /cars ``` ```http /products/{id} ``` ```http /beers/{id}/reviews/{id} ``` -------------------------------- ### Successful Response Example (JSON) Source: https://api.totvs.com.br/apidetails/Practitioner_v2_000.json Example of a successful JSON response when retrieving agenda provider records. Includes pagination and item details. ```json { "hasNext": true, "items": [ { "id": 1, "name": "Agenda User Name", "parentCode": 1, "itemagendaCode": "ITEM123", "agendaObservation": "Observation text", "itemagendaType": "Type A", "unidatendId": 10, "active": "S", "utzportalpaciente": "N", "utzteleconsulta": "N", "description": "Unit Description", "address": "123 Main St", "number": "456", "complemento": "Apt 7B", "neighborhood": "Downtown", "city": "Metropolis", "ufendereco": "MP", "imagem": 1, "geralCode": 100, "razaosocial": "Dr. John Doe", "utzfotoportalpaciente": "N", "entidadeprofId": "PROF12345", "consprofName": "Medical Council", "branchId": 1, "fantasiaName": "Clinic Name", "compradorCode": 50, "companyId": 1, "code": 1, "credId": 1, "consprofCode": 1 } ] } ``` -------------------------------- ### Versioning Example Source: https://api.totvs.com.br/guia Demonstrates the correct way to expose API versions in the URL, using only the major version. ```http /v1/{{recurso}} ``` ```http /v2/{{recurso}} ``` ```http /v3/{{recurso}} ``` -------------------------------- ### Field Selection Example with Fields Source: https://api.totvs.com.br/guia Demonstrates the use of the 'fields' parameter to retrieve specific attributes like 'rg' and 'nome'. ```http /user?fields=’rg,nome’ ``` -------------------------------- ### Pagination Example Source: https://api.totvs.com.br/guia Demonstrates how to paginate results using 'page' and 'pagesize' parameters. The response includes a 'hasNext' flag to indicate if more pages are available. ```json { "hasnext": true, "items": [ ... ] } ``` -------------------------------- ### Error Response Example (JSON) Source: https://api.totvs.com.br/apidetails/Practitioner_v2_000.json Example of a JSON error response when records cannot be retrieved. Includes error code, message, and detailed message. ```json { "code": "ERROR_CODE_123", "message": "Error retrieving records.", "detailedMessage": "An unexpected error occurred during data retrieval.", "helpUrl": "https://api.example.com/docs/errors/ERROR_CODE_123", "details": [] } ``` -------------------------------- ### Field Selection Example Source: https://api.totvs.com.br/guia Shows how to use the 'fields' parameter to specify desired attributes in the API response. Only the listed fields will be returned. ```json { "rg": "12345678", "nome": "carlos" } ``` -------------------------------- ### Filtering by Name and Surname Source: https://api.totvs.com.br/guia Example of filtering user resources by specifying both name and surname parameters. ```http /user?name=gilberto&surname=barros ``` -------------------------------- ### Minor Version Update Example Source: https://api.totvs.com.br/get-started When a minor version of an API is updated, the URL remains the same. This example shows a minor version change from 1.001. ```text 1.001 URL continua V1 ``` -------------------------------- ### Major Version Update Example Source: https://api.totvs.com.br/get-started A major version update requires the URL to be changed to reflect the new major version. This example shows a major version change from 1.001, necessitating a URL update to V2. ```text 1.001 URL DEVE ser alterada para V2 ``` -------------------------------- ### Basic JSON Example Source: https://api.totvs.com.br/get-started A simple JSON object representing a key-value pair, commonly used in API communication. ```json { "hello": "world" } ``` -------------------------------- ### Successful Response - Specialty Records Source: https://api.totvs.com.br/apidetails/Specialty_v2_000.json Example JSON response when specialty records are successfully retrieved. Includes detailed fields for each specialty. ```json { "hasNext": true, "items": [ { "id": 1, "name": "Cardiologia", "parentCode": 1, "itemagendaCode": "CARDIO", "agendaObservation": "", "itemagendaType": "", "unidatendId": 1, "active": "S", "utzportalpaciente": "N", "utzteleconsulta": "N", "description": "Cardiologia Clínica", "address": "Rua das Flores, 123", "number": "123", "complemento": "Apto 4B", "neighborhood": "Centro", "city": "São Paulo", "ufendereco": "SP", "imagem": 1, "geralCode": 1, "razaosocial": "Dr. João Silva", "utzfotoportalpaciente": "N", "entidadeprofId": "CRM12345", "consprofName": "Conselho Regional de Medicina", "branchId": 1, "fantasiaName": "Hospital Central", "compradorCode": 1, "companyId": 1, "code": 1, "credId": 1, "consprofCode": 1 } ] } ``` -------------------------------- ### TOTVS API URL Structure Example Source: https://api.totvs.com.br/get-started This is the standard URL structure for TOTVS APIs. It includes host, API group, version, and resource. Ensure your resource is in plural form and avoid using verbs in the endpoint. ```text http://{{host}}/api/{{agrupador}}/{{versão}}/{{recurso}} ``` -------------------------------- ### Successful Response - Agenda Units Source: https://api.totvs.com.br/apidetails/Unity_v2_000.json Example of a successful response when retrieving agenda units. The response includes a boolean indicating if there are more items and an array of agenda unit objects. ```json { "hasNext": true, "items": [ { "id": 1, "name": "Agenda Name", "parentCode": 1, "itemagendaCode": "ITEM1", "agendaObservation": "Observation", "itemagendaType": "Type", "unidatendId": 1, "active": "S", "utzportalpaciente": "N", "utzteleconsulta": "N", "description": "Description", "address": "Address", "number": "123", "complemento": "Complement", "neighborhood": "Neighborhood", "city": "City", "ufendereco": "UF", "imagem": 1, "geralCode": 1, "razaosocial": "Doctor Name", "utzfotoportalpaciente": "N", "entidadeprofId": "12345", "consprofName": "Medical Council", "branchId": 1, "fantasiaName": "Branch Name", "compradorCode": 1, "companyId": 1, "code": 1, "credId": 1, "consprofCode": 1 } ] } ``` -------------------------------- ### Error Response - Record Retrieval Source: https://api.totvs.com.br/apidetails/Unity_v2_000.json Example of an error response when records cannot be retrieved. Includes error code, message, detailed message, and an optional help URL. ```json { "code": "string", "message": "string", "detailedMessage": "string", "helpUrl": "uri", "details": [] } ``` -------------------------------- ### Error Response - Record Retrieval Failure Source: https://api.totvs.com.br/apidetails/Specialty_v2_000.json Example JSON response for an error during record retrieval. Provides error codes, messages, and potential help URLs. ```json { "code": "ERROR_CODE_HERE", "message": "An error occurred while retrieving records.", "detailedMessage": "Detailed technical error message.", "helpUrl": "http://example.com/docs/error", "details": [] } ``` -------------------------------- ### Retrieve All Resources Source: https://api.totvs.com.br/apidetails/Menus_v1_001.json Returns all resources available in the system. Supports query parameters for ordering, pagination, and page size. ```APIDOC ## GET /api/framework/v1/menus ### Description Retrieves a collection of all available resources (menus). ### Method GET ### Endpoint /api/framework/v1/menus ### Parameters #### Query Parameters - **order** (string[]) - Optional - Specifies the sorting order for the collection. - **page** (integer(int32)) - Optional - Specifies the page number for pagination. - **pageSize** (integer(int32)) - Optional - Specifies the number of items per page. #### Header Parameters - **Authorization** (string) - Required - Header used for request authorization. ### Request Body _Does not have a request body._ ### Response #### Success Response (200) - **hasNext** (boolean) - **items** (object[]) - **items.id** (string) - Required - Unique identifier for the resource. - **items.name** (string) - Required - Description of the resource. - **items.parentId** (string) - Required - Identifier of the parent resource. - **items.launchPath** (string) - Required. - **items.type** (string) - Required - Type of the resource. - **items.custom** (object) - Unavailable #### Error Response (409) - **code** (string) - Required - Error code identifier. - **message** (string) - Required - User-friendly error message in the request language. - **detailedMessage** (string) - Required - More detailed technical error message. - **helpUrl** (string(uri)) - URI for error documentation. - **details** (object[]) ``` -------------------------------- ### Processos seletivos (venda online de cursos) Source: https://api.totvs.com.br/referencelist API for the selection processes entity (online course sales). ```APIDOC ## Processos seletivos (venda online de cursos) ### Description API for the selection processes entity (online course sales). ### Version 1.000 ### Available in: RM ### Also available in: Agrupadores: Educacional ``` -------------------------------- ### Sorting by Name and Age Source: https://api.totvs.com.br/guia Illustrates how to sort user resources by name alphabetically, with age as a secondary sorting criterion (descending). ```http /users?order=name,-age ``` -------------------------------- ### Insumos para Projetos Source: https://api.totvs.com.br/referencelist API for project inputs. ```APIDOC ## Insumos para Projetos ### Description API of inputs for projects. ### Version 1.000 ### Available in: RM ### Also available in: Agrupadores: Construção e Projetos ``` -------------------------------- ### List Agenda Providers (TL++) Source: https://api.totvs.com.br/apidetails/Practitioner_v2_000.json Retrieves a list of agenda providers using TL++ syntax. Supports filtering, sorting, and pagination. Requires an Authorization header. ```tlpp GET /api/hcg/v2/practitioner Authorization: Bearer [TOKEN] companyId: 1 active: true ``` -------------------------------- ### List Agenda Providers (Java) Source: https://api.totvs.com.br/apidetails/Practitioner_v2_000.json Retrieves a list of agenda providers using Java. Supports filtering, sorting, and pagination. Requires an Authorization header. ```java OkHttpClient client = new OkHttpClient().newBuilder().build(); Request request = new Request.Builder() .url("https://api.example.com/api/hcg/v2/practitioner?companyId=1&active=true") .addHeader("Authorization", "Bearer [TOKEN]") .build(); Response response = client.newCall(request).execute(); ``` -------------------------------- ### List Agenda Providers (C#) Source: https://api.totvs.com.br/apidetails/Practitioner_v2_000.json Retrieves a list of agenda providers using C#. Supports filtering, sorting, and pagination. Requires an Authorization header. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage { Method = HttpMethod.Get, RequestUri = new Uri("https://api.example.com/api/hcg/v2/practitioner?companyId=1&active=true"), }; request.Headers.Add("Authorization", "Bearer [TOKEN]"); HttpResponseMessage response = await client.SendAsync(request); ``` -------------------------------- ### Cotação de Compra Source: https://api.totvs.com.br/referencelist API for the maintenance of the purchase quotation registration. ```APIDOC ## Cotação de Compra ### Description API for maintenance of the purchase quotation registration. ### Version 1.000 ### Available in: Logix ### Also available in: Agrupadores: Supply Chain ``` -------------------------------- ### Retrieve Resources by Parent ID Source: https://api.totvs.com.br/apidetails/Menus_v1_001.json Returns all resources associated with a specific parent resource ID. This allows for hierarchical retrieval of menus. ```APIDOC ## GET /api/framework/v1/menus/{parentId} ### Description Retrieves a collection of resources filtered by a specific parent resource ID. ### Method GET ### Endpoint /api/framework/v1/menus/{parentId} ### Parameters #### Path Parameters - **parentId** (string) - Required - Unique identifier representing the parent resource. #### Header Parameters - **Authorization** (string) - Required - Header used for request authorization. ### Request Body _Does not have a request body._ ### Response #### Success Response (200) - **hasNext** (boolean) - **items** (object[]) - **items.id** (string) - Required - Unique identifier for the resource. - **items.name** (string) - Required - Description of the resource. - **items.parentId** (string) - Required - Identifier of the parent resource. - **items.launchPath** (string) - Required. - **items.type** (string) - Required - Type of the resource. - **items.custom** (object) - Unavailable ``` -------------------------------- ### Centro de Custo Source: https://api.totvs.com.br/referencelist API for registering Cost Centers for TOTVS products. ```APIDOC ## Centro de Custo ### Description API for registering Cost Centers for TOTVS products. ### Version 1.000 ### Available in: Protheus ### Also available in: RM Agrupadores: Serviços ``` -------------------------------- ### Appointment Source: https://api.totvs.com.br/referencelist API for Appointment Scheduling for TOTVS products. ```APIDOC ## Appointment ### Description API for Appointment Scheduling for TOTVS products. ### Version 1.000 ### Available in: RM ### Also available in: Agrupadores: Saúde ``` -------------------------------- ### Standard List Response Structure Source: https://api.totvs.com.br/guia A standard TOTVS API response for a list should contain '_hasNext' to indicate further pagination and 'items' for the requested data. ```json { "hasNext": true, "items":[ { "nome": "prod1", "id" : 1 }, { "nome": "prod2", "id": 2 } ] } ``` -------------------------------- ### List Agenda Providers Source: https://api.totvs.com.br/apidetails/Practitioner_v2_000.json Retrieves a list of agenda providers. Supports filtering, sorting, and pagination. Requires an Authorization header. ```javascript const myHeaders = new Headers(); myHeaders.append("Authorization", "Bearer [TOKEN]"); const requestOptions = { method: 'GET', headers: myHeaders, redirect: 'follow' }; fetch("https://api.example.com/api/hcg/v2/practitioner?companyId=1&active=true", requestOptions) .then(response => response.json()) .then(result => console.log(result)) .catch(error => console.error('error', error)); ``` -------------------------------- ### List Practitioners Source: https://api.totvs.com.br/apidetails/Practitioner_v2_000.json Retrieves a list of practitioner records based on specified query parameters. This endpoint allows for filtering, sorting, and pagination of practitioner data. ```APIDOC ## GET /api/hcg/v2/practitioner ### Description Returns a list of practitioner records. Supports filtering, sorting, and pagination. ### Method GET ### Endpoint /api/hcg/v2/practitioner ### Parameters #### Query Parameters - **order** (string[]) - Optional - Collection sorting. - **page** (integer(int32)) - Optional - Collection pagination. - **pageSize** (integer(int32)) - Optional - Number of items per page. - **fields** (string) - Optional - Filtering records fields. - **companyId** (integer) - Optional - Company code. - **active** (string) - Optional - Active status. - **visible** (string) - Optional - Visible status. - **activeOnPortal** (string) - Optional - Active on portal status. - **specialtyId** (string) - Optional - Specialty code. - **unityId** (string) - Optional - Unit code. #### Header Parameters - **Authorization** (string) - Required - Header used for request authorization. ### Request Body _Does not have a body!_ ### Response #### Success Response (200) - **rm** (object) - **hasNext** (boolean) - **items** (object[]) - **items.id** (integer(int32)) - Identifier. - **items.name** (string) - Agenda User. *required* - **items.parentCode** (integer(int32)) - Parent type code. - **items.itemagendaCode** (string) - Code in general registration. - **items.agendaObservation** (string) - Agenda Observations. - **items.itemagendaType** (string) - Item type. - **items.unidatendId** (integer(int32)) - Attendance unit identifier. - **items.active** (string) - Agenda Status. - **items.utzportalpaciente** (string) - USES PATIENT PORTAL. - **items.utzteleconsulta** (string) - USES TELECONSULTATION. - **items.description** (string) - Description. - **items.address** (string) - ADDRESS. - **items.number** (string) - ADDRESS NUMBER. - **items.complemento** (string) - ADDRESS COMPLEMENT. - **items.neighborhood** (string) - NEIGHBORHOOD. - **items.city** (string) - CITY. - **items.ufendereco** (string) - ADDRESS STATE. - **items.imagem** (number) - Image. - **items.geralCode** (integer(int32)) - General Code. - **items.razaosocial** (string) - Doctor's Name. - **items.utzfotoportalpaciente** (string) - USES PROVIDER PHOTO ON PATIENT PORTAL. - **items.entidadeprofId** (string) - Professional Identity. - **items.consprofName** (string) - Professional Council Name. - **items.branchId** (integer(int16)) - Branch Identifier Code. - **items.fantasiaName** (string) - Branch Trade Name. - **items.compradorCode** (integer(int32)) - Provider Code. - **items.companyId** (integer(int16)) - Company code. *required* - **items.code** (integer(int32)) - Code. *required* - **items.credId** (integer(int32)) - Credential sequential number. - **items.consprofCode** (integer(int16)) - Professional Council Code. #### Response Example ```json { "rm": { "hasNext": true, "items": [ { "id": 123, "name": "Dr. John Doe", "parentCode": 1, "itemagendaCode": "A001", "agendaObservation": "Morning appointments", "itemagendaType": "TypeA", "unidatendId": 10, "active": "Y", "utzportalpaciente": "N", "utzteleconsulta": "Y", "description": "Main Clinic", "address": "123 Main St", "number": "456", "complemento": "Suite 100", "neighborhood": "Downtown", "city": "Anytown", "ufendereco": "CA", "imagem": 1, "geralCode": 500, "razaosocial": "John Doe Medical Group", "utzfotoportalpaciente": "Y", "entidadeprofId": "12345", "consprofName": "Medical Board", "branchId": 1, "fantasiaName": "Anytown Clinic", "compradorCode": 200, "companyId": 1, "code": 1001, "credId": 50, "consprofCode": 30 } ] } } ``` #### Error Response (404) - **rm** (object) - **code** (string) - Error identifier. *required* - **message** (string) - Literal in the request language describing the error to the user. *required* - **detailedMessage** (string) - More detailed technical error message. *required* - **helpUrl** (string(uri)) - URI for error documentation. - **details** (object[]) #### Error Response Example ```json { "rm": { "code": "PRACTITIONER_NOT_FOUND", "message": "Practitioner records could not be retrieved.", "detailedMessage": "An unexpected error occurred while querying the database for practitioners.", "helpUrl": "http://example.com/docs/errors/PRACTITIONER_NOT_FOUND", "details": [] } } ``` ``` -------------------------------- ### Listar Registros de Unidade da Agenda Source: https://api.totvs.com.br/apidetails/Unity_v2_000.json Retrieves a list of agenda unit records. Supports filtering by various criteria, sorting, and pagination. ```APIDOC ## GET /api/hcg/v2/unity ### Description Returns a list of agenda unit records. Supports filtering by active status, portal visibility, specialty, and more. Includes pagination and sorting capabilities. ### Method GET ### Endpoint /api/hcg/v2/unity ### Parameters #### Query Parameters - **order** (string[]) - Optional - Collection sorting. - **page** (integer(int32)) - Optional - Collection pagination. - **pageSize** (integer(int32)) - Optional - Number of items per page. - **fields** (string) - Optional - Filtering records fields. - **companyId** (integer) - Required - Company ID. - **active** (string) - Optional - Indicates if the unit is active. - **visible** (string) - Optional - Indicates if the unit is visible. - **activeOnPortal** (string) - Optional - Indicates if the unit is active on the portal. - **specialtyId** (string) - Optional - Specialty code. #### Header Parameters - **Authorization** (string) - Required - Header used for request authorization. ### Request Body _Does not have a body!_ ### Response #### Success Response (200) - **hasNext** (boolean) - **items** (object[]) - **items.id** (integer(int32)) - Identifier. Field: GIMAGEM.ID - **items.name** (string) - Agenda User. Required. Field: SZAGENDA.NOME - **items.parentCode** (integer(int32)) - Agenda type code. Field: SZAGENDA.CODIGOPARENT - **items.itemagendaCode** (string) - General registry code. Field: SZAGENDA.CODITEMAGENDA - **items.agendaObservation** (string) - Agenda observations. Field: SZAGENDA.OBSAGENDA - **items.itemagendaType** (string) - Item type. Field: SZAGENDA.TIPOITEMAGENDA - **items.unidatendId** (integer(int32)) - Attendant unit identifier. Field: SZUNIDATEND.IDUNIDATEND - **items.active** (string) - Agenda status. Field: SZAGENDA.ATIVO - **items.utzportalpaciente** (string) - USES PATIENT PORTAL - **items.utzteleconsulta** (string) - USES TELECONSULTATION - **items.description** (string) - Description. Field: SZUNIDATEND.DESCRICAO - **items.address** (string) - ADDRESS. Field: SZUNIDATEND.ENDERECO - **items.number** (string) - ADDRESS NUMBER. Field: SZUNIDATEND.NUMERO - **items.complemento** (string) - ADDRESS COMPLEMENT. Field: SZUNIDATEND.COMPLEMENTO - **items.neighborhood** (string) - NEIGHBORHOOD. Field: SZUNIDATEND.BAIRRO - **items.city** (string) - CITY. Field: SZUNIDATEND.CIDADE - **items.ufendereco** (string) - ADDRESS UF. Field: SZUNIDATEND.UFENDERECO - **items.imagem** (number) - Image. Field: GIMAGEM.IMAGEM - **items.geralCode** (integer(int32)) - General Code. Field: SZCADGERAL.CODGERAL - **items.razaosocial** (string) - Doctor's Name. Field: SZCADGERAL.RAZAOSOCIAL - **items.utzfotoportalpaciente** (string) - USES DOCTOR PHOTO ON PATIENT PORTAL - **items.entidadeprofId** (string) - Professional Identity. - **items.consprofName** (string) - Council Name. Field: SZCONSPROF.NOMECONSPROF - **items.branchId** (integer(int16)) - Branch Identifier Code. Field: GFILIAL.CODFILIAL - **items.fantasiaName** (string) - Branch Trade Name. Field: GFILIAL.NOMEFANTASIA - **items.compradorCode** (integer(int32)) - Agreement Code. Field: SZCREDENCIAMENTODETALHE.CODCOMPRADOR - **items.companyId** (integer(int16)) - Colleague code. Required. Field: SZAGENDA.CODCOLIGADA - **items.code** (integer(int32)) - Code. Required. Field: SZAGENDA.CODIGO - **items.credId** (integer(int32)) - Credential sequential. Field: SZCREDENCIAMENTODETALHE.IDCRED - **items.consprofCode** (integer(int16)) - Professional Council Code. Field: SZCONSPROF.CODCONSPROF #### Response Example ```json { "hasNext": true, "items": [ { "id": 1, "name": "Agenda 1", "parentCode": 10, "itemagendaCode": "ITEM1", "agendaObservation": "Observation 1", "itemagendaType": "Type 1", "unidatendId": 100, "active": "S", "utzportalpaciente": "N", "utzteleconsulta": "N", "description": "Unit Description 1", "address": "123 Main St", "number": "1", "complemento": "Apt 101", "neighborhood": "Downtown", "city": "Metropolis", "ufendereco": "MP", "imagem": 1, "geralCode": 1000, "razaosocial": "Dr. Smith", "utzfotoportalpaciente": "S", "entidadeprofId": "PROF123", "consprofName": "Medical Council", "branchId": 1, "fantasiaName": "Branch Name 1", "compradorCode": 50, "companyId": 1, "code": 1, "credId": 10, "consprofCode": 20 } ] } ``` #### Error Response (404) - **code** (string) - Error identifier. Required. - **message** (string) - Literal in the request language describing the error to the user. Required. - **detailedMessage** (string) - More detailed technical error message. Required. - **helpUrl** (string(uri)) - URI for error documentation. - **details** (object[]) #### Error Response Example ```json { "code": "NOT_FOUND", "message": "Records not found.", "detailedMessage": "No agenda units found matching the criteria.", "helpUrl": "http://example.com/docs/errors/not_found", "details": [] } ``` ``` -------------------------------- ### List Laboratory Exam Results Source: https://api.totvs.com.br/apidetails/LaboratoryExamResult_v2_000.json Returns a list of laboratory exams/results for a patient. ```APIDOC ## GET /api/hcg/v2/laboratory-exams-results/patient ### Description Retrieves a list of laboratory exams and results for a specific patient. ### Method GET ### Endpoint /api/hcg/v2/laboratory-exams-results/patient ### Parameters #### Query Parameters - **companyId** (integer) - Required - Identifier of the company. - **PatientId** (integer) - Required - Code of the Patient. - **ResultPage** (integer) - Optional - Page number for the results. - **PageSize** (integer) - Optional - Number of results per page. #### Header Parameters - **Authorization** (string) - Required - Header used for request authorization. ### Request Body This endpoint does not have a request body. ### Response #### Success Response (200) - The response will contain a list of laboratory exams and results. Specific fields are not detailed in the source. #### Response Example (No specific response example provided in the source.) ``` -------------------------------- ### List Laboratory Exam Results Source: https://api.totvs.com.br/apidetails/LaboratoryExamResult_v2_000.json Retrieves a list of laboratory exam results with pagination support. It returns a collection of exam result objects, each containing detailed information about the exam, patient, sample, and file. ```APIDOC ## GET /laboratory-exam-results ### Description Retrieves a paginated list of laboratory exam results. ### Method GET ### Endpoint /laboratory-exam-results ### Parameters #### Query Parameters - **page** (integer) - Optional - The page number to retrieve. - **size** (integer) - Optional - The number of items per page. ### Response #### Success Response (200) - **hasNext** (boolean) - Indicates if there are more pages. - **found** (boolean) - Indicates if any records were found. - **Page** (integer) - The current page number. - **Items** (object array) - An array of laboratory exam result objects. - **Items.code** (string) - Required - Entity Key (e.g., SZPEDEXAMEITEM.CODCOLIGADA|SZPEDEXAMEITEM.ORDEMSERVICO|SZPEDEXAMEITEM.CODEXAME|SZPEDEXAMEITEM.SEQEXAME). - **Items.companyId** (integer) - Required - Company Code (e.g., SZPEDEXAMEITEM.CODCOLIGADA). - **Items.serviceOrder** (integer) - Required - Exam Order Number (e.g., SZPEDEXAMEITEM.ORDEMSERVICO). - **Items.examId** (integer) - Required - Exam Code (e.g., SZPEDEXAMEITEM.CODEXAME). - **Items.sequential** (integer) - Required - Exam Sequential (e.g., SZPEDEXAMEITEM.SEQEXAME). - **Items.methodCode** (integer) - Required - Method Used in Exam (e.g., SZMETODOSEXAMES.CODMETODO). - **Items.methodCodeDescription** (string) - Required - Method Description (e.g., SZMETODOSEXAMES.DESCMETODO). - **Items.type** (string) - Required - Exam Type (e.g., SZPEDEXAMEITEM.TIPOEXAME). - **Items.examDescription** (string) - Exam Description (e.g., SZLABEXAME.DESCEXAME). - **Items.materialCode** (string) - Required - Material Code (e.g., SZLABMATERIALEXAME.CODMATERIAL). - **Items.materialDescription** (string) - Material Description (e.g., SZLABMATERIALEXAME.DESCMATERIAL). - **Items.collectDate** (date) - Required - Collection Date (e.g., SZPEDEXAMEITEM.DATACOLETA). - **Items.date** (date) - Required - Exam Date (e.g., SZPEDEXAME.DATAEXAME). - **Items.mnemonic** (string) - Required - Mnemonic (e.g., SZLABEXAME.MNEMONICO). - **Items.patient** (object) - Patient details. - **Items.patient.code** (string) - Required - Entity Key (e.g., SZPPACIENTE.CODCOLIGADA|SZPPACIENTE.PACIENTE). - **Items.patient.CompanyId** (integer) - Required - Company Code (e.g., SZPPACIENTE.CODCOLIGADA). - **Items.patient.PatientId** (integer) - Required - Patient Code (e.g., SZPPACIENTE.CODPACIENTE). - **Items.patient.medicalRegistration** (string) - Required - Patient Protocol (e.g., SZPPACIENTE.PRONTUARIO). - **Items.patient.name** (string) - Required - Patient Name (e.g., SZPPACIENTE.NOMEPACIENTE). - **Items.patient.socialName** (string) - Required - Patient Social Name (e.g., SZPPACIENTE.NOMESOCIAL). - **Items.patient.cpf** (string) - Required - CPF (e.g., SZPPACIENTE.CPF). - **Items.patient.generalResitration** (string) - Required - Patient Identity (e.g., SZPPACIENTE.IDENTIDADE). - **Items.patient.gender** (string) - Required - Patient Gender (e.g., SZPPACIENTE.SEXO). - **Items.patient.birthDate** (date) - Required - Birth Date (e.g., SZPPACIENTE.DATANASC). - **Items.patient.motherName** (string) - Required - Mother's Name (e.g., SZPPACIENTE.NOMEMAE). - **Items.patient.address** (string) - Required - Address (e.g., SZPPACIENTE.NOMEMAE). - **Items.patient.neighborhood** (string) - Required - Neighborhood (e.g., SZPPACIENTE.BAIRRO). - **Items.patient.city** (string) - Required - City (e.g., SZPPACIENTE.CIDADE). - **Items.patient.state** (string) - Required - State (e.g., SZPPACIENTE.UFENDERECO). - **Items.patient.postalCode** (string) - Required - Postal Code (e.g., SZPPACIENTE.CEP). - **Items.patient.email** (string) - Required - Email (e.g., SZPPACIENTE.EMAIL). - **Items.patient.commercialPhonePrefix** (string) - Commercial Phone DDD (e.g., SZPPACIENTE.DDDTELCOM). - **Items.patient.commercialPhoneNumber** (string) - Commercial Phone Number (e.g., SZPPACIENTE.TELCOM). - **Items.patient.homePhoneNumberPrefix** (string) - Contact Phone DDD (e.g., SZPPACIENTE.DDDTELCONT). - **Items.patient.homePhoneNumber** (string) - Contact Phone Number (e.g., SZPPACIENTE.TELCONT). - **Items.sample** (object) - Sample details. - **Items.sample.code** (string) - Required - Entity Key (e.g., SZAMOSTRAS.CODCOLIGADA|SZAMOSTRAS.AMOSTRA). - **Items.sample.companyId** (integer) - Required - Company Code (e.g., SZAMOSTRAS.AMOSTRA). - **Items.sample.sampleId** (integer) - Required - Sample Code (e.g., SZAMOSTRAS.AMOSTRA). - **Items.sample.canisterCode** (integer) - Required - Canister Code (e.g., SZAMOSTRAS.CODVASILHAME). - **Items.sample.date** (date) - Required - Sample Date (e.g., SZAMOSTRAS.DATAAMOSTRA). - **Items.sample.expirationDate** (date) - Required - Expiration Date (e.g., SZAMOSTRAS.DATAVALIDADE). - **Items.results** (object) - Results details. - **Items.results.parameterCode** (integer) - Required - Parameter Code (e.g., SZLABPARAMEXAMES.CODPARAMETRO). - **Items.results.resultDate** (date) - Required - Result Date (e.g., SZPEDEXAMERESULT.RECCREATEDBY). - **Items.results.value** (string) - Required - Result Value (e.g., SZPEDEXAMERESULT.RESULTADO). - **Items.file** (object) - File details. - **Items.file.name** (string) - Required - File Name (e.g., SZARQUIVO.NOMEARQUIVO). - **Items.file.description** (string) - File Description (e.g., SZARQUIVO.DESCRICAO). - **Items.file.file** (string) - File Content. - **Items.file.base64Content** (string) - Required - File Content in Base64 (e.g., SZARQUIVO.ARQUIVO). ### Request Example ```json { "page": 1, "size": 10 } ``` ### Response Example ```json { "hasNext": true, "found": true, "Page": 1, "Items": [ { "code": "1_0009_10100_1", "companyId": 10, "serviceOrder": 10, "examId": 10100, "sequential": 1, "methodCode": 1, "methodCodeDescription": "Method Description", "type": "N", "examDescription": "HEMOGRAMA", "materialCode": "M1", "materialDescription": "Blood", "collectDate": "2023-10-26", "date": "2023-10-27", "mnemonic": "HGB", "patient": { "code": "1_0009", "CompanyId": 1, "PatientId": 9, "medicalRegistration": "10009", "name": "JOHN DOE", "socialName": "JOHN DOE", "cpf": "1234567890123", "generalResitration": "SP-11565998", "gender": "F", "birthDate": "1990-05-15", "motherName": "Jane Doe", "address": "123 Main St", "neighborhood": "Downtown", "city": "Metropolis", "state": "SP", "postalCode": "12345-678", "email": "john.doe@example.com", "commercialPhonePrefix": "11", "commercialPhoneNumber": "12345678", "homePhoneNumberPrefix": "11", "homePhoneNumber": "87654321" }, "sample": { "code": "1_0009", "companyId": 1, "sampleId": 9, "canisterCode": 1, "date": "2023-10-26", "expirationDate": "2024-10-26" }, "results": [ { "parameterCode": 100, "resultDate": "2023-10-27", "value": "14.5" } ], "file": { "name": "report.pdf", "description": "Exam Report", "file": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgICAgMCAgIDAwMEAwMEBgQFBgUFBQ...", "base64Content": "JVBERi0xLjQKJcOkw7z..." } } ] } ``` ``` -------------------------------- ### List Specialties Source: https://api.totvs.com.br/apidetails/Specialty_v2_000.json Retrieves a list of appointment specialties. Supports filtering, sorting, and pagination. ```javascript get /api/hcg/v2/specialty ``` -------------------------------- ### List Agenda Units Source: https://api.totvs.com.br/apidetails/Unity_v2_000.json Retrieves a list of agenda units with various filtering and sorting options. Requires companyId and Authorization headers. ```javascript get /api/hcg/v2/unity ``` -------------------------------- ### List Response Pattern Source: https://api.totvs.com.br/get-started This JSON structure is used to indicate that there are more records available in a list response. It includes a 'hasNext' boolean and an 'items' array. ```json { "hasNext":true, "items":[...] } ``` -------------------------------- ### Error Response Pattern Source: https://api.totvs.com.br/get-started This JSON structure provides a standardized way to return error information from TOTVS APIs. It includes an error code, a message, a detailed message, and an optional help URL. ```json { "code":"FW001", "message":"Registro já cadastrado", "detailedMessage":"Este registro já foi cadastrado verifique os valores enviados", "helpUrl":"http://totvs.help.com.br/registro" } ``` -------------------------------- ### Asynchronous Request Status Source: https://api.totvs.com.br/guia Illustrates the expected JSON response for pending asynchronous operations, indicating that the communication was successful but processing is ongoing. ```json { "status": "pending" } ``` -------------------------------- ### Standardized API Error Message Structure Source: https://api.totvs.com.br/guia API TOTVS error messages are standardized for easier interpretation. The '_detail' property is a list that can contain specific error information. ```json { "code": "fw01", "message" : "invalid property", "details":[ {...} ] } ``` -------------------------------- ### Expandable Attributes in API Response Source: https://api.totvs.com.br/guia This snippet shows how the '_expandables' property indicates which attributes were retracted and can be expanded in the response. ```json { "_expandables": ["permissions", ...] } ```