List / search for units.

Action name: searchUnits

Fields in the json-encoded "data" parameter:

namedescriptionformatrequired
fieldsrequested unit properties for the search result, see belowObjecttrue
filterfilter for the search resultListtrue
warningswether to check for warnings, only aplicable when from and till is set in the filterB 
sortingcan be a unit property or one of: 'price', 'random', 'rating', 'stars'S 
idsunit ids for subsequent calls (pagination)List 
maxmaximal number of results, default is 18, max is 64  

 

NOTE: Live search is for now restricted to 600 units max. If you've got more units in total, you may not use use this function but use your own database by exporting the units through the export.

NOTE: Live search is only allowed with pagination in place. If you've got more than 64 units, subsequent results may only be fetched on user interaction (e.g. pagination or infinite scroll).

 

Possible requested fields:

 

Requested fields can be all unit properties (global and custom ones). See unit export for possible values. In addition these special fields can be requested:

namedescription
calc.totaltotal price for the selected period
calc.oTotal 
calc.discountName 
idxImageindex image path

A field is specified as {'u.fieldname':{filter:projection}}, see projection for details.

 

Possible filter values:

You can filter for all unit properties (global and custom ones). See unit export for possible values.

Append '_min' or '_max' to the fieldname for integer values, like 'beds_min'.

In addition these special values can be used:

namedescription
fromyyyy-MM-dd
tillyyyy-MM-dd
regionregion path, like "France/Provence/Cote.d-Azur/Vence"
regionid 
unitgroupidunit group id
facilityidfacility id
adults 
children 
babys 
name(first letters of) unit name OR unit id
price_min 
price_max 

 

Sample request data:

{
"fields": {
"u.name": {"filter": "vautolang"},
"u.loc.coordinates": {},
"u.path": {"filter": "vlang"},
"u.idxImage": {},
"u.calc.total": {"filter": "vcurrency"},
    },

    "filter": {
"adults": "4",
"children": "1",
"babys": "0"
},
"sorting": "random"
}

 

NOTE: Sorting or filtering by price is more expensive and will cost more credits.

 

Sample result:

{
ids: [2344,2342343,3423423,...],
units: [
{name: 'App. 04', type: 'Ferienwohnung'},
{name: 'App. 05', type: 'Ferienwohnung'},
....
],
ok: true
}

Note: On first call, you will get a list of all unit-ids in the result-set and the first page of data. To get other pages, you need to add a sublist of these ids to the request.