How to use Query Options in Swagger (LMS365 API)

You can use query options in Swagger to control the amount and order of the data returned in the response:

989.png

See the examples below.

  • Expand Query Option ($expand)

The '$expand' option allows you to return related entries with a single URI. Entities that it is possible to expand can be seen in the property's Model:

96.png

Specify one or several comma-separated properties, then click Execute:

123.png

It is possible to use nested '$expand':

90.png

  • Filter Query Option ($filter)

Use the '$filter' option to return only the items meeting the desired condition:

21.png

It is possible to add filter by expanded properties as well: 

1234.png

  • Select Query Option ($select)

Specify the separate properties you would like to get in the response:

12345.png

  • Orderby Query Option ($orderby)

Use the '$orderby' option to order the items returned in the response:

78.png

It is possible to sort the response by expanded property as well:

91.png

  • Top Query Option ($top)

Use the '$top' option to return only the first N items of the result:

92.png

Note: might be useful when sorting the result with the 'orderby' option:

94.png

  • Skip Query Option ($skip)

It might be necessary to skip several items returned, especially when sorting the data. Use the '$skip' option for that:

98.png

Check OData documentation to find more examples and information.  

Was this article helpful?
0 out of 0 found this helpful

Comments

Please sign in to leave a comment.