APIv2 PREVENTECH

Preventech REST API v2 em JSON

Este documento tem como objectivo detalhar e especificar o funcionamento do módulo de interfaces (INT) no contexto do sistema de Gestão de Corporações.

GET Authentication

Para autenticar um utilizador é necessário uma chave de API e um Token. Todos os endpoints da API estão disponíveis via HTTPS. O Acesso HTTP é negado. Cada chave de API autentica um utilizador dentro de uma conta e é composta por caracteres gerados aleatóriamente. Essa chave deve ser passada no header do pedido. Embora toda a comunicação esteja encriptada, aconselhamos a manter este token o mais seguro possível para evitar que terceiros tentem aceder aos dados.

Outro parâmetro a constar no header dos pedidos é o Token que será utilizado em todas as comunicações. Este Token é válido durante 7 dias pelo que deverá ser renovado.

É possível realizar até 100 pedidos por minuto para cada conta. Se este limite for excedido, receberá uma resposta de 429 Too Many Requests.

Recomendamos o tratamento deste tipo de erros de forma a controlar os pedidos seguintes.

https://api.preventech.pt/api/v2/authentication
HEADERS

Accept
application/json

apikey
c8aac87a47bd9798f150ebb7245e8cd9

Chave de API fornecida

Example Request
                                                
GET https://api.preventech.pt/api/v2/authentication
                                            
GET Incidents List
https://api.preventech.pt/api/v2/gescorp/incidents/incidentsList?date_from=13-08-2024&date_to=14-08-2024
HEADERS

Accept
application/json

PARAMS

date_from
13-08-2024

Data início da Ocorrência

date_to
14-08-2024

Data fim da Ocorrência

Example Request
                                                
GET https://api.preventech.pt/api/v2/gescorp/incidents/incidentsList?date_from=13-08-2024&date_to=14-08-2024
                                            
GET Incidents List By ID
https://api.preventech.pt/api/v2/gescorp/incidents/incidentsList/17663339
HEADERS

Accept
application/json

Example Request
                                                
GET https://api.preventech.pt/api/v2/gescorp/incidents/incidentsList/17663339
                                            
GET Incidents Classifications List
https://api.preventech.pt/api/v2/gescorp/incidentsclassification/incidentsClassificationList
HEADERS

Accept
application/json

Example Request
                                                
GET https://api.preventech.pt/api/v2/gescorp/incidentsclassification/incidentsClassificationList
                                            
GET Incidents Time Table List
https://api.preventech.pt/api/v2/gescorp/incidents/incidentsTimeTapeList?id_ocorrencia=17663339&tipo=comunicacao&origem=gescorp
HEADERS

Accept
application/json

PARAMS

id_ocorrencia
17663339

ID Ocorrência

tipo
comunicacao

Opções: comunicacao, posit

origem
gescorp

Opções: gescorp, sigmos

Example Request
                                                
GET https://api.preventech.pt/api/v2/gescorp/incidents/incidentsTimeTapeList?id_ocorrencia=17663339&tipo=comunicacao&origem=gescorp
                                            
GET Incidents Type State List
https://api.preventech.pt/api/v2/gescorp/incidentstypestate/incidentsTypeStateList
HEADERS

Accept
application/json

Example Request
                                                
GET https://api.preventech.pt/api/v2/gescorp/incidentstypestate/incidentsTypeStateList
                                            
GET Incidents Mapping Tables List
https://api.preventech.pt/api/v2/gescorp/incidentsmappingtables/incidentsMappingTablesList?tabela=All
HEADERS

Accept
application/json

PARAMS

tabela
All

Opções: All, Source, Status, Parishes, Cities, Districts

Example Request
                                                
GET https://api.preventech.pt/api/v2/gescorp/incidentsmappingtables/incidentsMappingTablesList?tabela=All
                                            
PUT Update Incidents Vehicle
https://api.preventech.pt/api/v2/gescorp/incidents/updateIncidentsVehicle
HEADERS

Accept
application/json

BODY raw

Example Request
POST Insert Incidents Time Tape Entry
https://api.preventech.pt/api/v2/gescorp/incidents/insertIncidentsTimeTape
HEADERS

Accept
application/json

BODY raw

Example Request
GET Firefighters List
https://api.preventech.pt/api/v2/gescorp/firefighters/firefightersList
HEADERS

Accept
application/json

Example Request
                                                
GET https://api.preventech.pt/api/v2/gescorp/firefighters/firefightersList
                                            
GET Firefighters List By ID
https://api.preventech.pt/api/v2/gescorp/firefighters/firefightersList/33729
HEADERS

Accept
application/json

Example Request
                                                
GET https://api.preventech.pt/api/v2/gescorp/firefighters/firefightersList/33729
                                            
GET Entities List
https://api.preventech.pt/api/v2/gescorp/entities/entitiesList?email=api@gmail.com&nif=999999990&tipo=socio
HEADERS

Accept
application/json

PARAMS

email
api@gmail.com

Email

nif
999999990

NIF

tipo
socio

Opções: socio, particular, entidade

Example Request
                                                
GET https://api.preventech.pt/api/v2/gescorp/entities/entitiesList?email=api@gmail.com&nif=999999990&tipo=socio
                                            
GET Entities List By ID
https://api.preventech.pt/api/v2/gescorp/entities/entitiesList/649707?tipo=socio
HEADERS

Accept
application/json

PARAMS

tipo
socio

Opções: socio, particular, entidade

Example Request
                                                
GET https://api.preventech.pt/api/v2/gescorp/entities/entitiesList/649707?tipo=socio
                                            
GET Members List
https://api.preventech.pt/api/v2/gescorp/members/membersList?email=api.gmail.com&nif=999999990
HEADERS

Accept
application/json

PARAMS

email
api.gmail.com

Email

nif
999999990

NIF

Example Request
                                                
GET https://api.preventech.pt/api/v2/gescorp/members/membersList?email=api.gmail.com&nif=999999990
                                            
GET Members List By ID
https://api.preventech.pt/api/v2/gescorp/members/membersList/423451?tipo=socio
HEADERS

Accept
application/json

PARAMS

tipo
socio

Opções: socio, particular, entidade

Example Request
                                                
GET https://api.preventech.pt/api/v2/gescorp/members/membersList/423451?tipo=socio
                                            
GET Vehicles List
https://api.preventech.pt/api/v2/gescorp/vehicles/vehiclesList
HEADERS

Accept
application/json

Example Request
                                                
GET https://api.preventech.pt/api/v2/gescorp/vehicles/vehiclesList
                                            
GET Vehicles List GPS
https://api.preventech.pt/api/v2/gescorp/vehicles/vehiclesGPS
HEADERS

Accept
application/json

Example Request
                                                
GET https://api.preventech.pt/api/v2/gescorp/vehicles/vehiclesGPS
                                            
GET Vehicles List By ID
https://api.preventech.pt/api/v2/gescorp/vehicles/vehiclesList/77
HEADERS

Accept
application/json

Example Request
                                                
GET https://api.preventech.pt/api/v2/gescorp/vehicles/vehiclesList/77
                                            
GET Incidents List
https://api.preventech.pt/api/v2/sigmos/incidents/incidentsList?date_from=06-02-2024&date_to=06-02-2024
HEADERS

Accept
application/json

PARAMS

date_from
06-02-2024

Data início da Ocorrência

date_to
06-02-2024

Data fim da Ocorrência

Example Request
                                                
GET https://api.preventech.pt/api/v2/sigmos/incidents/incidentsList?date_from=06-02-2024&date_to=06-02-2024
                                            
GET Incidents List By ID
https://api.preventech.pt/api/v2/sigmos/incidents/incidentsList/192291
HEADERS

Accept
application/json

Example Request
                                                
GET https://api.preventech.pt/api/v2/sigmos/incidents/incidentsList/192291