Sometimes it's useful to search for a specific String in multiple attributes.
Given that URL query parameters do not allow OR conditions, we took the extra step and provide you with an easy query parameter that allows you to search the following fields at the same time:
labelnamedescriptionusernamefirstNamelastName
In order to search for a specific string on all fields just add the query parameter search=string.
GET https://industrial.api.ubidots.com/api/v2.0/variables/?search=demo
//Returns Array 'results' containing all variables that have the string 'demo' in either of the 6 fields
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"label": "demo",
"name": "Demo",
"description": "",
...
}
]
}
FeatureThe
searchparameter is even more powerful. You can append the following parameters to enhance your search capabilities:
iexact(Case Insensitive)containsicontains(Case Insensitive)startswithistartswith(Case Insensitive)endswithiendswith(Case Insensitive)For more information about these parameters, please refer to the Text section.
