Client driven paging

For large data sets, the client might want to limit the amount of entitites returned, for example show 10 entities at a time with a link to the next 10 results. To do this, the client uses the $top and the $skip options as parameters in the URL.

The $top option limits the number of entities to return and the $skip option tells the server to skip a number of entities in the result set.

Example:

http://localhost/api/competitions/{competitionId}/matches?$top=10&$skip=20

This call fetches the third page in a set with a page length of 10 entities (i.e. the results # 21 - 30).

Filtering

The $filter option makes it possible for the client to filter the result set by applying a boolean expression.

Example:

http://localhost/api/competitions/{competitionId}/matches?$filter=HomeTeam eq 'Onyx IBK'

This call returns all matches for a competition with home team Onyx IBK

Using $select

The $select option specifies a subset of properties to include for each entity in the result set.

NOTE: To include collection properties in the result set, the $expand option must be used with the $select option. See example 2 below.

Example 1

http://localhost/api/competitions/{competitionId}/matches?$select=MatchID,HomeTeam

This call returns a list of matches for a competition with only the properties MatchID and HomeTeam included in the result set.

Example 2

http://localhost/api/competitions/{competitionId}/matches?$select=MatchID,HomeTeam,Events&$expand=Events

This call returns a list of matches for a competition with the properties MatchID, HomeTeam and Events included in the result set.