Integration of occurrences using the API
Documentation on how to integrate incidents using the Ronda senior X API.
General prerequisites
- Be authenticated in Ronda senior X;
- Have a type of occurrence registered in Ronda senior X;
- Have physical locations registered with Ronda senior X;
- Pass the token in the Header.
Consult Occurrence
Call the serviceGET /incident/pagedsearch/all to consult a paginated list with all user occurrences;
In Postman, the page and total pages must be passed as a parameter (query): https://sam-api.senior.com.br/api/v1/incident/pagedsearch/all?page=1&pageSize=10
Register Occurrence
To register a new occurrence, the type of occurrence and the physical location selected are necessary. Carry out the following procedures:
- Call the serviceGET /incidenttype to select the type of occurrence;
- In postman, you need to pass the token and enter the URL: https://sam-api.senior.com.br/api/v1/incidenttype;
- Call the serviceGET /physicallocation/search for auto-complete search of physical locations;
- In postman, the term and location situation must be passed as a parameter: https://sam-api.senior.com.br/api/v1/physicallocation/search?term=company&situation=1
To save the incident:
- Call the servicePOST /incident;
- Pass the JSON in the Body;
- Assemble the JSON with the incident data, the physical location ID and description, the incident type ID and description, the current date, status, priority, incident description, and device or camera ID, depending on the origin of the incident . If the source is a device, the JSON will have the "device" object and will not have the "camera", and vice versa;
- If there are people associated with the occurrence, the people array must be informed.
Note
The Data data must have the following format: "2017-03-24T10:09:00-03:00".
Json example:
{
"id": 0,
"physicalLocation":
{
"id": 1,
"name": "Reception"
},
"incidentType":
{
"id": 2,
"name": "Test Name"
},
"date": "2017-03-27T11:07:17.841734-03:00",
"status": "PENDING",
"priority": "MEDIUM",
"description": "Test Name",
"device":
{
"id": 11,
"name": "",
"deviceType": 0
},
"people": [],
"user":
{
"id": 1,
"name": "Name"
},
"procedures":
]
"string"
]
}
Example of the returned Json (status 200):
{
"id": 5,
"physicalLocation":
{
"id": 1,
"name": "Company"
},
"incidentType":
{
"id": 2,
"name": "test name"
},
"date": "2017-03-27T11:22:23.332202-03:00",
"status": "PENDING",
"priority": "MEDIUM",
"description": "Test Name",
"device":
{
"id": 11,
"name": "DIMEP Biopoint II Access - 10.1.42.168",
"deviceType": 0
},
"people": [],
"user":
{
"id": 1,
"name": "Name"
},
"procedures": []
}
Service information
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 | DataType |
|---|---|---|---|
| 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 an array of Incident Type
Response Class (Status 200)
An array of Incident Type
[
{
"id": 0,
"name": "string",
"description": "string",
"isWatched": true
}
]
Parameters
| Parameter | Description | Parameter Type | DataType |
|---|---|---|---|
| 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)
An array of basic info from physical location limited by 10 retults
[
{
"id": 0,
"nameWithPath": "string"
}
]
Parameters
| Parameter | Description | Parameter Type | DataType |
|---|---|---|---|
| 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 | DataType |
|---|---|---|---|
| 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" } |
Note
For more information about the Ronda senior X APIs in general, see thedetailed documentation of these APIs.





