Payload Common Concepts

In this article you can find more information about how to define and encode request payloads.

Encoding

  • The JSON payload for PUT and POST methods  must be UTF-8 encoded.

  • The parameter names and values must be UTF-8 encoded.

  • The parameter values must be escaped in case they contain special characters like:
    / ? : @ - . _ ~ ! $ & ' ( ) * + , ; =

Condition Parameters

Some endpoints allow you to specify parameters in the query string that are used to filter results (e.g. all things located in UK).
You can define multiple conditions, and all conditions are evaluated in AND on the target collection.

Property based condition can use on one of the following predicates to check values:

Comparison Predicates

Equal

Checks if the value in a property matches a specific value.

Evaluation: case-sensitive

Compatible Types: STRING | NUMBER | BOOLEAN

{{PROP_NAME}}=eq;abc Equals to abc.

{{PROP_NAME}}=eq; Is empty.

Not equal

Checks if the value in a property does not match a specific value.

Evaluation: case-sensitive

Compatible Types: STRING | NUMBER | BOOLEAN

{{PROP_NAME}}=neq;abc Not equals to abc.

{{PROP_NAME}}=neq; Is not empty.

Exists

Check the nullness of a property.

Compatible Types: STRING | NUMBER | BOOLEAN | OBJECT

{{PROP_NAME}}=exists;true Is not null.

{{PROP_NAME}}=exists;false Is null.

Like

Checks if the value in a property matches a pattern with wildcards.

Evaluation: NOT case-sensitive

Compatible Types: STRING

{{PROP_NAME}}=like;abc* Starts with abc.

{{PROP_NAME}}=like;*abc* Contains abc.

{{PROP_NAME}}=like;*abc Ends with abc

Not like

Checks if the value in a property does not match a pattern with wildcards.

Evaluation: NOT case-sensitive

Compatible Types: STRING

{{PROP_NAME}}=notLike;abc* Not starts with abc.

{{PROP_NAME}}=notLike;*abc* Not contains abc.

{{PROP_NAME}}=notLike;*abc Not ends with abc.

Set-Based Predicates

In

Checks whether the value of a property is contained in a given set of values.

Evaluation: NOT case-sensitive

Compatible Types: STRING | NUMBER | BOOLEAN

{{PROP_NAME}}=in;foo,bar

Not in

Checks whether the value of a property is not contained in a given set of values.

Evaluation: NOT case-sensitive

Compatible Types: STRING | NUMBER | BOOLEAN

{{PROP_NAME}}=nin;foo,bar

Number-Based Predicates

Greater than

Checks if the value in a property is strictly greater than a specific value.

Compatible Types: NUMBER

{{PROP_NAME}}=gt;123

Greater than or equal to

Checks if the value in a property is greater than or equal to a specific value.

Compatible Types: NUMBER

{{PROP_NAME}}=gte;123

Less than

Checks if the value in a property is strictly less than a specific value.

Compatible Types: NUMBER

{{PROP_NAME}}=lt;123

Less than or equal to

Checks whether the value of a property is less than or equal to a specific value.

Compatible Types: NUMBER

{{PROP_NAME}}=lte;123

Here is an example of request to get all things with a condition on serial number and country.

GET {{baseUrl}}/v2/inventory/things?serialNumber=like;sw*&location.country=eq;Italy