Learn VisualLearn API

Query Parameters Narrow the Response, Not the Resource

Query parameters adjust the results returned from a collection. A filter like ?status=active keeps only the rows that match a condition. A sort like ?sort=-created_at orders the results, where the leading - means descending. Choosing fields, like ?fields=id,name, selects only the fields returned for each row.

All three only adjust the results of a request to the same collection. They don't change the resource it targets. /users?status=active still targets the users collection, with its results narrowed.

GOAL

Combine a filter, a sort order, and a field selection in query parameters, and explain why each narrows the response without naming a different resource.

What does the leading - in ?sort=-created_at mean?