This page introduces you to a few concepts which will help you consume the REST API and also shape your queries to your needs.




Table of contents:






What is a Query String?

A query string is defined by using the question mark (?) character after the URL being requested, and it defines what is being sent to the server for processing.
Query strings are typically used to pass extra data or "instructions" to the receiving server, and are encoded using name=value pairs.

Ex: http://receiving-server-url?name=value

Parameters (name=value)

In the request above the parameter is the pair following the question mark.
It is always a pair, where the first part is the name of the parameter, followed by an equals sign (=) and then the value of the parameter.
Say, you want to modify how the server is sorting the response it is supplying, and the server allows you do that using a parameter name called: sorting_order.
You could use the following query string to achieve that, ex: http://receiving-server-url?sorting_order=ascending or http://receiving-server-url?sorting_order=descending

The Ampersand (&)

Ampersands are used to separate a list of parameters being sent to the receiving server.
Say, you want to modify how the server is sorting the response it is supplying, and also limit the number of elements you want to receive.
Suppose the server allows you to modify the numbers of elements returned using the parameter name: limit.
You could use the following query string to achieve that, ex: http://receiving-server-url?sorting_order=ascending&limit=100


As a summary, use a question mark (?) to start the query string and apply an Ampersand (&) for more than one parameter in the query.
Each parameter is a pair and is encoded as name=value.


  • No labels