Get service parameters
This endpoint retrieves the value of the parameters configured for a service.
GET /api/v1/businesses/{business_id}/services/{service_id}/service_parameters/{key}
The value of key can be found in the Business configuration > Defined parameters section, in the key column. |
If the data included in the request is correct — businessId, serviceId and key — the response will contain the value defined for the parameter within the indicated service, following the structure below:
-
key: identifier for the parameter.
-
categoryType: category in which the parameter is included. Can be:
-
PLANNING - Planning management.
-
NEEDS - Needs management.
-
CLOCK_GUARD - Clockings management.
-
REPORTS - Reports management.
-
OTHER - Global parameters.
-
-
values: defined values for the parameter.
The content of the response varies depending on the service parameter being queried and how it is configured in the system. Below are some examples.
To query the counters displayed in the payroll report, the following request is made:
GET /api/v1/businesses/{business_id}/services/{service_id}/service_parameters/payroll.businesscounters
The response indicates the configuration established for this parameter, including the category (Reports) and the identifiers of the selected counters.
[
{
"key": "payroll.businesscounters",
"categoryType": "REPORTS",
"values": {
"value": [
4866,
4865
]
}
}
]
To query the schedules configured for the HD (home delivery) section, the following request is made:
GET /api/v1/businesses/{business_id}/services/{service_id}/service_parameters/HDTimetable
The response indicates the configuration established for this parameter, including the category (Needs) and the different values for each type of day.
[
{
"key": "HDTimetable",
"categoryType": "NEEDS",
"values": {
"value": true,
"dayTypeId": "MONDAY",
"initTime": "10:00",
"endTime": "15:00"
}
},
{
"key": "HDTimetable",
"categoryType": "NEEDS",
"values": {
"value": true,
"dayTypeId": "WEEKENDS",
"initTime": "08:00",
"endTime": "10:00"
}
},
{
"key": "HDTimetable",
"categoryType": "NEEDS",
"values": {
"value": false,
"dayTypeId": "WEDNESDAY",
"initTime": "10:00",
"endTime": "14:00"
}
}
]
Considerations
If the parameter is not active in the business or no configuration has been defined within the service, the request will return a 404 Not Found
error indicating Service Param not Found.
Useful links
What is a service/store parameter?