Holiday integration using the API
Documentation on how to integrate holidays, using the Ronda senior X API.
General prerequisites
- Be authenticated in Ronda senior X;
- Pass the token in the Header.
Consult a holiday list
- Call the serviceGET /holidaylist to consult the list of registered holidays;
- In the postman, only the token must be passed as a parameter: https://sam-api.senior.com.br/api/v1/holidaylist
Register a holiday list
To save the holiday:
- Call the servicePOST /holidaylist;
- Pass the JSON in the Body;
- Assemble the JSON with the holiday list data, list description, holiday description, indicate whether the holiday is recurring and the holiday date.
Note
The date must have the following format: "2017-03-24T10:09:00-03:00". The recurrence item considers "0" as non-recurring and "1" as recurring.
JSON example
{
"id": 0,
"name": "Holiday in the list",
"holiday":
[
{
"id": 0,
"name": "Test Name",
"date": "2017-03-24T03:00:00.000Z",
"recurrent": 0
},
{
"id": 0,
"name": "Test Name2",
"date": "2017-03-24T08:00:00.000Z",
"recurrent": 1
}
]
}
Returned Json example (status 200)
{
"id": 4,
"name": "Holiday in the list",
"holiday":
[
{
"id": 5,
"name": "Test Name",
"date": "2017-03-24",
"recurrent": 0
},
{
"id": 6,
"name": "Test Name2",
"date": "2017-03-24",
"recurrent": 1
}
]
}
Delete a holiday list
- Call the serviceDELETE /holidaylist/{id};
- In the postman, the holiday list ID must be passed as a parameter in the URL: https://sam-api.senior.com.br/api/v1/holidaylist/{holidayList}
If the service returns successfully (HTTP 200), there will be no JSON returned.
Modify a holiday list
{
"id": 2,
"name": "National Holiday",
"holiday":
[
{
"id": 0,
"name": "Christmas",
"date": "2017-12-25T10:52:00-03:00",
"recurrent": 1
},
{
"id": 0,
"name": "New year",
"date": "2017-12-31T10:52:00-03:00",
"recurrent": 1
}
]
}
If the service returns successfully (HTTP 200), there will be no JSON returned.
Service information
Implementation Notes
Returns an array with the list of holidays
Response Class (Status 200)
A holiday list array
[
{
"id": 0,
"name": "string",
"holiday": [
{
"id": 0,
"name": "string",
"date": "string",
"recurrent": 0
}
]
}
]
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
Creates a new Holiday list. The ID field will be ignored
Response Class (Status 200)
Holiday list created
{
"id": 0,
"name": "string",
"holiday": [
{
"id": 0,
"name": "string",
"date": "string",
"recurrent": 0
}
]
}
Parameters
| Parameter | Description | Parameter Type | Data Type |
|---|---|---|---|
| token | Authentication token | header | string |
| Holiday list | Holiday list | body | { "id": 0, "name": "string", "holiday": [ { "id": 0, "name": "string", "date": "string", "recurrent": 0 } ] } |
Response Messages
| HTTP Status Code | Reason | Response Model |
|---|---|---|
| 401 | Token is invalid or expired | |
| 403 | No permission to modify the list | |
| 500 | Server error | { "code": 0, "message": "string" } |
Implementation Notes
Deletes a holiday list
Parameters
| Parameter | Description | Parameter Type | Data Type |
|---|---|---|---|
| token | Authentication token | header | string |
| id | ID of the holiday list | path | long |
Response Messages
| HTTP Status Code | Reason | Response Model |
|---|---|---|
| 200 | Holiday list deleted | |
| 401 | Token is invalid or expired | |
| 403 | Operation denied | |
| 404 | Holiday list not found | |
| 500 | Server error | { "code": 0, "message": "string" } |
Implementation Notes
Updates a holiday list
Parameters
| Parameter | Description | Parameter Type | Data Type |
|---|---|---|---|
| token | Authentication token | header | string |
| Holiday list | Holiday list | path | { "id": 0, "name": "string", "holiday": [ { "id": 0, "name": "string", "date": "string", "recurrent": 0 } ] } |
Response Messages
| HTTP Status Code | Reason | Response Model |
|---|---|---|
| 200 | Holiday list updated | |
| 401 | Token is invalid or expired | |
| 403 | No permission to modify the list | |
| 404 | Holiday list not found | |
| 500 | Server error | { "code": 0, "message": "string" } |





