POST

Create Filter

Creates a new filter for a specific endpoint.

You can use filters to apply them on endpoints in order to get sub-sets of entities.

For example, if you want to get trademarks containing the word law and the registry US you have to create a filter for the endpoint firmportfolio and then apply it.

Payload to create a filter for the example above would be very similar to:

So, basically, you have to define groups of expressions for each condition on each property: one group for each property, and one, or more, expressions for each condition.

Another example: if you want to include a new registry, for example GB, you should add a new expression into the first group:

Note that operator_next contains the nexus with next expression. On this sample an OR ( because we want trademarks from both: US or GB ).

The example above is similar to create this filter on the web UI.

Properties available to create filters depend on each endpoint. Check method Filters on each endpoint to get a list of all properties available.

Important

Calls to this method must include the cookie .LawPanel.AuthCookie in order to identify you at user level. For more details about authentication please check this link. To obtain the cookie you can use the method Login.

Request URL

Request headers

string
Subscription key which provides access to this API.

Request body

Request payload to create the filter.

  • string Required end_point: The endpoint for the filter. For example, if you want to create a filter to select a sub-set of registries, you should use the endpoint registries. Check each endpoint documentation.
  • string Optional name: A human readable name for the filter.
  • bool Optional applied: If true the filter will be applied by default on next READ many operation for the current user. It's important to remember that filters exist at user level.
  • object Requiredfilter_definition: An object containing a single property named groups. Where groups is an array of objects with these properties:
    Object properties are:
    • array Required expressions: An array of objects with these properties:
      Object properties are:
      • string Required property_name: Name of the property for the expression. You have to get them checking each endpoint Filter method. For example, to get all properties available to create filters for trademarks, check its Filters method.
      • string Required comparator: A string containing the comparator to be applied with over the value. Each endpoint with method Filter provide a list of all comparators available for each property. For example, you can check trademarks Filters and its comparators available.
      • string Required value: A string containing the value to be compared with saved property.
      • string Required operator_next: Logic nexus with next expression. Available values are AND, OR.
    • string Required operator_next: Logic nexus with next group. Available values are AND, OR.

Loading...
                  {
  "type": "object",
  "properties": {
    "name": {},
    "end_point": {
      "type": "string"
    },
    "it_is_last_used_without_save": {
      "type": "boolean"
    },
    "applied": {
      "type": "boolean"
    },
    "filter_definition": {
      "type": "object",
      "properties": {
        "groups": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "expressions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "property_name": {
                      "type": "string"
                    },
                    "comparator": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    },
                    "operator_next": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "property_name",
                    "comparator",
                    "value",
                    "operator_next"
                  ]
                }
              },
              "operator_next": {
                "type": "string"
              }
            },
            "required": [
              "expressions",
              "operator_next"
            ]
          }
        }
      }
    }
  },
  "example": {
    "name": null,
    "end_point": "firmportfolio",
    "it_is_last_used_without_save": true,
    "applied": false,
    "filter_definition": {
      "groups": [
        {
          "expressions": [
            {
              "property_name": "mark_text",
              "comparator": "CONTAINS",
              "value": "lawpanel",
              "operator_next": "AND"
            }
          ],
          "operator_next": "AND"
        }
      ]
    }
  }
}
                  
              

Response 201

Returns a representation of filter created. Use returned id as filter_id parameter on READ many endpoint.

Loading...
{
  "type": "object",
  "properties": {
    "enable": {
      "type": "boolean"
    },
    "id": {
      "type": "string"
    },
    "end_point": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "applied": {
      "type": "boolean"
    },
    "filter_definition": {
      "type": "object",
      "properties": {
        "groups": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "expressions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "property_name": {
                      "type": "string"
                    },
                    "comparator": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    },
                    "personalized": {
                      "type": "boolean"
                    },
                    "operator_next": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "property_name",
                    "comparator",
                    "value",
                    "personalized",
                    "operator_next"
                  ]
                }
              },
              "operator_next": {
                "type": "string"
              }
            },
            "required": [
              "expressions",
              "operator_next"
            ]
          }
        }
      }
    }
  },
  "example": {
    "id": "66c4ef28-2429-46f3-b815-ab870165e520",
    "end_point": "firmportfolio",
    "name": "'law' in US",
    "applied": false,
    "filter_definition": {
      "groups": [
        {
          "expressions": [
            {
              "property_name": "registry.id",
              "comparator": "==",
              "value": "783c0667-2884-4d0a-b93b-a6720147e45f",
              "operator_next": "OR"
            }
          ],
          "operator_next": "AND"
        },
        {
          "expressions": [
            {
              "property_name": "mark_text",
              "comparator": "CONTAINS",
              "value": "law",
              "operator_next": "AND"
            }
          ],
          "operator_next": "AND"
        }
      ]
    }
  }
}
* See getting started for more information on how to use this API. You can also check the API change history.