Role suspension integration using the API
Documentation on how to integrate paper suspension using the Ronda senior X API.
General prerequisites
- Be authenticated in Ronda senior X;
- Have a person registered in Ronda senior X;
- Have a registered role in Ronda senior X;
- A person must be related to a role;
- Pass the token in the Header.
Consult role suspension
- Call the serviceGET /person/role/suspension/{id} to consult the paper suspensions that the person has;
- In the postman, the person-role link ID must be passed as a parameter in the URL: https://sam-api.senior.com.br/api/v1/person/role/suspension/{personRoleLink}
Register a role suspension
The save the role suspension:
- Call the servicePOST /person/role/suspension;
- Pass the JSON in the Body;
- Assemble the JSON with the suspension data. The person-role link ID and the start date are mandatory. The end date and the justification are optional.
Note
The start and end dates must have the following format: "2017-03-24T10:09:00-03:00".
Json example:
{
"id": 0,
"personRoleId": 39,
"startDate": "2017-03-24T20:03:00-03:00",
"endDate": "2017-03-24T21:03:00-03:00",
"justification": "Test"
}
Return Json example (status 200):
{
"id": 6,
"personRoleId": 39,
"startDate": "2017-03-24T23:03:00Z",
"endDate": "2017-03-25T00:03:59Z",
"justification": "Test"
}
Delete role suspension
- Call the serviceDELETE /person/role/suspension/{id};
- In the postman, the ID of the suspension must be passed in the URL as a parameter: https://sam-api.senior.com.br/api/v1/person/role/{suspensionId}
If the return of the service is a success (HTTP 200), there will be no return Json.
Modify the role suspension
{
"id": 9,
"personRoleId": 39,
"startDate": "2017-03-24T17:46:00-03:00",
"endDate": "2017-03-25T21:45:00-03:00",
"justification": "Test"
}
If the service returns successfully (HTTP 200), there will be no JSON returned.
Service information
Implementation Notes
Returns all suspensions for the person-role association
Response Class (Status 200)
Returns all suspensions for the person-role association
[
{
"roleId": 0,
"roleName": "string",
"personRoleSuspensionId": 0,
"startDate": "string",
"endDate": "string",
"justification": "string"
}
]
Parameters
| Parameter | Description | Parameter Type | Data Type |
|---|---|---|---|
| token | Authentication token | header | string |
| id | ID of the person-role association | path | long |
Response Messages
| HTTP Status Code | Reason | Response Model |
|---|---|---|
| 401 | Token is invalid or expired | |
| 404 | Person-role association not found | |
| 500 | Server error | { "code": 0, "message": "string" } |
Implementation Notes
Suspends an association between a person and a role
Parameters
| Parameter | Description | Parameter Type | Data Type |
|---|---|---|---|
| token | Authentication token | header | string |
| personRoleSuspension | Suspension for a person-role association | body | { "id": 0, "personRoleId": 0, "startDate": "string", "endDate": "string", "justification": "string" } |
Response Messages
| HTTP Status Code | Reason | Response Model |
|---|---|---|
| 200 | Person-role association suspended | |
| 401 | Token is invalid or expired | |
| 403 | Operation denied | |
| 500 | Server error | { "code": 0, "message": "string" } |
Implementation Notes
Deletes a suspension for an association between a person and a role
Parameters
| Parameter | Description | Parameter Type | Data Type |
|---|---|---|---|
| token | Authentication token | header | string |
| id | ID of a person-role association suspension | path | long |
Response Messages
| HTTP Status Code | Reason | Response Model |
|---|---|---|
| 200 | Suspension of the person-role association deleted | |
| 401 | Token is invalid or expired | |
| 403 | Operation denied | |
| 404 | Person not found | |
| 500 | Server error | { "code": 0, "message": "string" } |
Implementation Notes
Updates suspensions for an association between a person and a role
Parameters
| Parameter | Description | Parameter Type | Data Type |
|---|---|---|---|
| token | Authentication token | header | string |
| personRoleSuspension | Suspension for a person-role association | path | long |
Response Messages
| HTTP Status Code | Reason | Response Model |
|---|---|---|
| 200 | Suspension of a person-role association updated | |
| 401 | Token is invalid or expired | |
| 403 | Operation denied | |
| 500 | Server error | { "code": 0, "message": "string" } |





