Get locations by service

This endpoint returns all the enabled tasks within a service for its associated products.

GET /api/v1/businesses/{businessId}/services/{serviceId}/locations

If the information provided in the request is correct —both businessId and serviceId—, the response will contain the enabled tasks for each product and zone within the service.

Below is a sample response:

[
    {
        "color": "#c7d0e9",
        "description": "Opening tasks",
        "name": "OPENING",
        "shortName": "OP",
        "requiredLevel": 2,
        "priority": 4,
        "maxResources": 1,
        "type": "FIXED",
        "shouldAvoidOvercover": true,
        "system": false,
        "category": "Fixed tasks",
        "product": "0001-GENERAL",
        "id": "01",
        "active": true,
        "zone": "General"
    },
    {
        "color": "#c7d0e9",
        "description": "Opening tasks",
        "name": "OPENING",
        "shortName": "OP",
        "requiredLevel": 2,
        "priority": 4,
        "maxResources": 1,
        "type": "FIXED",
        "shouldAvoidOvercover": true,
        "system": false,
        "category": "Fixed tasks",
        "product": "0001-GENERAL",
        "id": "01",
        "active": true,
        "zone": "Z1"
    },
    {
        "color": "#425ea9",
        "description": "Replenishment of merchandise",
        "name": "REPLACEMENT",
        "shortName": "REP",
        "requiredLevel": 2,
        "priority": 3,
        "type": "FIXED",
        "shouldAvoidOvercover": false,
        "system": false,
        "category": "Operational",
        "product": "0001-GENERAL",
        "id": "05",
        "active": true,
        "zone": "General"
    }
]

As shown in the example, if a task is enabled in multiple zones of a product, the response will include one entry for each zone. In this case, the OPENING task appears in both General and Z1 zones of the 0001-GENERAL product.

If there are more products in the service with the same tasks enabled, the response will include one task entry per product and zone.

The level of detail in the response will depend on the information previously defined for the task. For example, if no description (description) was provided, that field will not be included.

Considerations

If there are no active tasks in the specified service, the response will be an empty array [].

If the service provided in the URL does not exist in the business, the request will return a 404 Not Found error, with the message not exits.

What is a task?

How is the structure of a task?