QUERY vs PATH parameters
Path parameter is a part of the URL and
takes you to end-point/resources and
give you the result of query from that resources.
Query parameter is NOT a part of the URL and they are
added to the url after the ? mark, as key and value
it is filtering the result of query. the end point/resource is
same but it acts like a search button and filter the result and
returns the response.
Additionally, query parameter can be null but path parameter
can't be null. If you don't append the path parameter, you will get
404 error. So you can use path parameter if you want to send the
data as mandatory.