Integração de ocorrências utilizando a API
Documentação de como realizar a integração de ocorrências, utilizando a API do Ronda senior X.
Pré-requisitos gerais
- Estar autenticado no Ronda senior X;
- Possuir um tipo de ocorrência cadastrada no Ronda senior X;
- Possuir locais físicos cadastrados no Ronda senior X;
- Passar o token no Header.
Consultar Ocorrência
Chame o serviço GET /incident/pagedsearch/all para consultar uma lista paginada com todas as ocorrências do usuário;
No postman, a página e o total de páginas devem ser passados por parâmetro (query): https://sam-api.senior.com.br/api/v1/incident/pagedsearch/all?page=1&pageSize=10
Cadastrar Ocorrência
Para cadastrar uma nova ocorrência, o tipo de ocorrência e o local físico selecionado são necessários. Efetue os seguintes procedimentos:
- Chame o serviço GET /incidenttype para selecionar o tipo de ocorrência;
- No postman, é preciso passar o token e informar a URL: https://sam-api.senior.com.br/api/v1/incidenttype;
- Chame o serviço GET /physicallocation/search para pesquisa auto-complete dos locais físicos;
- No postman, o term e a situação do local devem ser passados por parâmetro: https://sam-api.senior.com.br/api/v1/physicallocation/search?term=empres&situation=1
Para salvar a ocorrência:
- Chame o serviço POST /incident;
- Passe no Body o JSON;
- Monte o JSON com os dados da ocorrência, o ID e descrição do local físico, o ID e descrição do tipo de ocorrência, a data atual, status, prioridade, descrição da ocorrência e ID do dispositivo ou da câmera, dependendo da origem do incidente. Se a origem for um dispositivo, o JSON terá o objeto "device" e não terá o "camera", e vice-versa;
- Se existirem pessoas associadas à ocorrência, o array de pessoas deve ser informado.
Observação
O dado Data deve possuir a seguinte formatação: "2017-03-24T10:09:00-03:00".
Exemplo do Json:
{
"id": 0,
"physicalLocation":
{
"id": 1,
"name": "Recepção"
},
"incidentType":
{
"id": 2,
"name": "Teste Nome"
},
"date": "2017-03-27T11:07:17.841734-03:00",
"status": "PENDING",
"priority": "MEDIUM",
"description": "Teste Nome",
"device":
{
"id": 11,
"name": "",
"deviceType": 0
},
"people": [],
"user":
{
"id": 1,
"name": "Nome"
},
"procedures":
[
"string"
]
}
Exemplo do Json retornado (status 200):
{
"id": 5,
"physicalLocation":
{
"id": 1,
"name": "Empresa"
},
"incidentType":
{
"id": 2,
"name": "teste nome"
},
"date": "2017-03-27T11:22:23.332202-03:00",
"status": "PENDING",
"priority": "MEDIUM",
"description": "Teste Nome",
"device":
{
"id": 11,
"name": "Acesso DIMEP Biopoint II - 10.1.42.168",
"deviceType": 0
},
"people": [],
"user":
{
"id": 1,
"name": "Nome"
},
"procedures": []
}
Informações dos serviços
Implementation Notes
Return a paginated array of all incidents from user
Response Class (Status 200)
Return a paginated array of all incidents from user
[
{
"id": 0,
"physicalLocation": {
"id": 0,
"name": "string"
},
"incidentType": {
"id": 0,
"name": "string"
},
"date": "string",
"status": "PENDING",
"priority": "UNKNOWN"
}
]
Parameters
| Parameter | Description | Parameter Type | Data Type |
|---|---|---|---|
| token | Authentication token | header | string |
| page | page | query | integer |
| pagesize | pageSize | query | integer |
Response Messages
| HTTP Status Code | Reason | Response Model |
|---|---|---|
| 401 | Token is invalid or expired | |
| 500 | Server error | {
"code": 0, "message": "string" } |
Implementation Notes
Return a array of Incident Type
Response Class (Status 200)
A array of Incident Type
[
{
"id": 0,
"name": "string",
"description": "string",
"isWatched": true
}
]
Parameters
| Parameter | Description | Parameter Type | Data Type |
|---|---|---|---|
| token | Authentication token | header | string |
Response Messages
| HTTP Status Code | Reason | Response Model |
|---|---|---|
| 401 | Token is invalid or expired | |
| 500 | Server error | {
"code": 0, "message": "string" } |
Implementation Notes
Auto complete search to physical location
Response Class (Status 200)
A array of basic info from physical location limited by 10 retults
[
{
"id": 0,
"nameWithPath": "string"
}
]
Parameters
| Parameter | Description | Parameter Type | Data Type |
|---|---|---|---|
| token | Authentication token | header | string |
| term | Term of physical location name | query | string |
| situation | Physical location situation filter (0=ALL, 1=ACTIVE) | query | integer |
Response Messages
| HTTP Status Code | Reason | Response Model |
|---|---|---|
| 401 | Token is invalid or expired | |
| 500 | Server error | {
"code": 0, "message": "string" } |
Implementation Notes
Create a new Incident, Id field will be ignored
Response Class (Status 200)
Incident created
{
"id": 0,
"physicalLocation": {
"id": 0,
"name": "string"
},
"incidentType": {
"id": 0,
"name": "string",
"isWarningSound": true
},
"date": "string",
"creationDate": "string",
"status": "PENDING",
"priority": "PLANNED",
"description": "string",
"device": {
"id": 0,
"name": "string",
"deviceType": 0,
"readerTechnology": 0
},
"camera": {
"id": 0,
"name": "string"
},
"people": [
{
"id": 0,
"name": "string",
"mandatoryDocuments": [
{
"id": 0,
"documentType": {
"id": 0,
"name": "string",
"label": "string",
"mask": "string",
"required": true
},
"document": "string"
}
],
"preferentialEmail": {
"id": 0,
"preferential": true,
"emailAddress": "string"
},
"preferentialPhone": {
"id": 0,
"preferential": true,
"ddi": 0,
"phoneNumber": "string",
"extensionLine": "string",
"type": "UNDEFINED"
},
"lastFeedbackPollDate": "string",
"useSelfServiceTerminal": true
}
],
"user": {
"id": 0,
"name": "string"
},
"procedures": [
"string"
],
"incidentOrigin": "USER"
}
Parameters
| Parameter | Description | Parameter Type | Data Type |
|---|---|---|---|
| token | Authentication token | header | string |
| Incident | Incident | body | { "id": 0, "physicalLocation": { "id": 0, "name": "string" }, "incidentType": { "id": 0, "name": "string", "isWarningSound": true }, "date": "string", "creationDate": "string", "status": "PENDING", "priority": "PLANNED", "description": "string", "device": { "id": 0, "name": "string", "deviceType": 0, "readerTechnology": 0 }, "camera": { "id": 0, "name": "string" }, "people": [ { "id": 0, "name": "string", "mandatoryDocuments": [ { "id": 0, "documentType": { "id": 0, "name": "string", "label": "string", "mask": "string", "required": true }, "document": "string" } ], "preferentialEmail": { "id": 0, "preferential": true, "emailAddress": "string" }, "preferentialPhone": { "id": 0, "preferential": true, "ddi": 0, "phoneNumber": "string", "extensionLine": "string", "type": "UNDEFINED" }, "lastFeedbackPollDate": "string", "useSelfServiceTerminal": true } ], "user": { "id": 0, "name": "string" }, "procedures": [ "string" ], "incidentOrigin": "USER" } |
Response Messages
| HTTP Status Code | Reason | Response Model |
|---|---|---|
| 401 | Token is invalid or expired | |
| 403 | Operation denied | |
| 500 | Server error | {
"code": 0, "message": "string" } |
Nota
Para mais informações sobre as APIs do Ronda senior X de forma geral, veja a documentação detalhada dessas APIs.
English
Español
English
Español


