Get Search

Resource type: search

This can be used to search for data records based on defined criteria, similar to the search in enterprise. The type of record searched for is specified in the resource identifier (address, estate, searchcriteria).

Resource ID: address, estate, searchcriteria

Parameters (general):

See Search estate for more information on searching for estates.

See Search search criteria for more information on searching for search criteria.

  • input
    STRING. MANDATORY. Contains the search term to search for. This must not be empty. The address fields firstname, surname, company, default emailaddress and customerno (KdNr.) of all addresses will be searched through. If the search term appears in one of the searched fields of an address, this address is displayed in the response.

The search terms can be combined and are then used in an AND operation. Example: “Max Mustermann Musterfirma” finds the address with first name “Max”, surname “Mustermann” and company “Musterfirma”.

Parameters (address):

  • includecontactdata
    BOOLEAN. OPTIONAL. If true, then all email addresses are searched, not just the default email address. In addition, all telephone numbers are also searched.
  • casesensitive
    BOOLEAN. OPTIONAL. Search is case-sensitive.
  • searchparameter
    ARRAY. OPTIONAL. Array of fields to include in the search. If you want to search fields other than the standard fields, enter an array of field names here. Only these fields will then be searched for the input string. Example: ["Vorname", "Name"]
  • listlimit
    INTEGER. OPTIONAL. Maximum number of records returned.
  • sortby
    STRING. OPTIONAL. Field to sort by. The field names from the administration must be used. Here KdNr for customerno, Vorname for firstname, Name for surname, Zusatz1 for company, Email for emailaddress
  • sortorder
    STRING. OPTIONAL. Possible values: ASC or DESC. Ascending or descending.

Parameters (estate):

  • filterId
    INTEGER. Filter ID. This parameter can also be used to restrict the search of estates via estate filters created in enterprise. The filter IDs of your created filters can be read out via the API call Filter. For more information about filters, see our online help.
  • filter
    OBJECT. Key: field, value: array of objects with filter expressions in the format "status": [{"op": "=", "val": 1}]. With op you specify the operator. Possible values for op are the following SQL operators:

    is or =, >, <, >=, <=, != or <>, between, like, not like, in, not in

    For the operator like the value % can be specified as a placeholder.

    With val you specify the value which should be applied to the filtering. The individual filter expressions are linked with the AND operation. Multiple values or ranges for operators like IN or BETWEEN are specified in comma separated array notation.
    "objektart": [{"op": "IN","val": ["Zimmer","Haus"]}], "letzte_aktion ": [{"op": "BETWEEN","val": ["2020-01-01","2021-04-01"]}]}

Request example

{
    "actionid": "urn:onoffice-de-ns:smart:2.5:smartml:action:get",
    "resourceid": "address",
    "identifier": "",
    "resourcetype": "search",
    "parameters": {
        "input": "Max Mustermann"
    }
}

Response (address):

  • customerno
    Customer number
  • firstname
    First name in the address record
  • surname
    Last name in the address record
  • company
    Company in the address record
  • emailaddress
    Email addresses in the address record
  • primaryEmail
    Primary email address in the address record

Response example

...
                        {
                            "id": 10775,
                            "type": "address",
                            "elements": {
                                "customerno": 18446077777866,
                                "surname": "Mustermann",
                                "firstname": "Max",
                                "company": "",
                                "emailaddress": [
                                    "max.mustermann@test153.de"
                                ],
                                "primaryEmail": "m.mustermann@onoffice.de"
                            }
                        },
...