Typically when designing your API, query string parameters should be reserved for optional arguments.
So for example if ID is a required parameter, it is better to use this as the URI:
https://example.api.com/product/1234
instead of this:
https://example.api.com/product?id=1234
where 1234 is the ID of the requested product.
Of course there are always exceptions and I had a situation where I wanted to use a required query parameter.
ASP.NET Core can help you there by using the [Required] or [BindRequired] attributes on your action method parameters:
Both controllers will return a validation error when invoked without the id parameter: