Get needs templates by product

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

GET /api/v1/businesses/{business_id}/products/{product_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).

  • Product or section identifier (product_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 product or section for each of the days specified in the request interval.

Here is an example:

GET /api/v1/businesses/BUSINESSID/products/0001-G/needs-templates?fromDate=2024-05-31&toDate=2024-06-01
[
    {
        "productId": "0001-G",
        "date": "2024/05/31",
        "id": "17536",
        "templateName": "General"
    },
    {
        "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 on the specified days.

Considerations

If the product 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 Invalid days period.

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.

What are needs?

What are needs templates?