Get needs templates by service

This endpoint returns the needs templates that have been applied to a service within a period not exceeding 30 days.

GET /api/v1/businesses/{business_id}/services/{service_id}/needs-templates?fromDate={yyyy-MM-dd}&toDate={yyyy-MM-dd}

In the request URL, the following parameters must be specified:

  • Business identifier (business_id).

  • Service or store identifier (service_id).

  • Time interval for the query (fromDate/toDate) in the format yyyy-MM-dd.

If the data included in the URL is correct, the response will contain the needs templates applied to the service for each of the days specified in the request interval.

Here is an example:

GET /api/v1/businesses/BUSINESSID/services/0001/needs-templates?fromDate=2024-05-31&toDate=2024-06-01
[
    {
        "productId": "0001-HD",
        "date": "2024/05/31",
        "id": "42157",
        "templateName": "HD-Template"
    },
    {
        "productId": "0001-G",
        "date": "2024/05/31",
        "id": "17536",
        "templateName": "General"
    },
    {
        "productId": "0001-HD",
        "date": "2024/06/01",
        "id": "42157",
        "templateName": "HD-Template"
    },
    {
        "productId": "0001-G",
        "date": "2024/06/01",
        "id": "17537",
        "templateName": "Summer"
    }
]

As shown in the example, the request returns the needs templates applied to each product or section of the service on the specified days.

Considerations

If the service specified in the URL does not exist in the business, the request will return a 404 Not Found error, specifying in the message not exists.

If the time interval specified in the URL exceeds 30 days, the request will return a 400 Bad Request error, specifying in the message Period between dates cannot be longer than 30 days.

If there are no needs templates applied for the specified time period, the request will return a 404 Not Found error, specifying in the message There is not needs template on the requested information. It will also return this error if there are no needs templates defined in the service.

What are needs?

What are needs templates?