Documentation / Advanced

Query Filtering

Advanced filtering with WHERE queries

The WebinOne API supports powerful filtering using JSON Query Notation in the Where parameter.

Basic Structure

WHERE queries must have a conjunctive operator ($and or $or) at the root level:

{
  "$and": [
    {"$eq": {"Enabled": true}},
    {"$contains": {"Name": "test"}}
  ]
}

Comparison Operators

  • $eq - Equals
  • $not_eq - Not equals
  • $gt - Greater than
  • $gte - Greater than or equal
  • $lt - Less than
  • $lte - Less than or equal

String Operators

  • $contains - Contains substring
  • $not_contains - Does not contain
  • $starts - Starts with
  • $ends - Ends with

Array Operators

  • $in - Value in array
  • $not_in - Value not in array

Examples

Find Enabled Items

{"$and": [{"$eq": {"Enabled": true}}]}

Search by Name

{"$and": [{"$contains": {"Name": "API"}}]}

Date Range

{
  "$and": [
    {"$gte": {"ReleaseDate": "2026-01-01T00:00:00"}},
    {"$lte": {"ReleaseDate": "2026-12-31T23:59:59"}}
  ]
}

Multiple Conditions

{
  "$and": [
    {"$eq": {"Enabled": true}},
    {"$contains": {"Name": "Header"}},
    {"$in": {"ModuleId": [1522, 1528]}}
  ]
}

URL Encoding

Remember to URL-encode the WHERE parameter:

const where = {"$and": [{"$eq": {"Enabled": true}}]};
const encoded = encodeURIComponent(JSON.stringify(where));
const url = `/api/v2/admin/snippets?Where=${encoded}`;

Code Examples

# Complex Query Example
const where = {
  "$and": [
    {"$eq": {"Enabled": true}},
    {
      "$or": [
        {"$contains": {"Name": "header"}},
        {"$contains": {"Name": "footer"}}
      ]
    },
    {"$gte": {"LastUpdatedDate": "2026-01-01T00:00:00"}}
  ]
};

const url = `https://your-site.webinone.com/api/v2/admin/snippets?Where=${encodeURIComponent(JSON.stringify(where))}`;

const response = await fetch(url, {
  headers: {
    'Authorization': `Bearer ${token}`
  }
});