list_resources (version 1)
Returns resources defined in a Planyo site or meta site along with additional information and photos. You can specify a resource filter. Note: old name of this function was get_all_resources
. You can still use that function name instead.
detail_level int optional
Sum of one or more of the following integers (ORed value): 1=resource name, 2=resource settings (quantity, site_id, confirmation_type, category, unit_names, resource admin info), 4=resource properties (resource-specific properties), 8=resource photos. Default value is 1 (name only).
page int optional
Zero-based page number. The default is 0. Max. number of results per page is defined by by default 100. Note: you can change the page size (max 300) with the page_size parameter.
list_published_only bool optional
Set to true if you only want published resources to be returned. False (default) will list all resources.
list_reservable_only bool optional
Set to true if you only want reservable resources to be returned. A resource is not reservable if it can be only reserved as part of a package. False (default) will list all resources.
admin_id int optional
You can optionally filter the resources returned by the ID of the resource administrator. When this parameter is skipped, all resources will be returned.
prop_res_xyz string optional
Resource-specific properties (defined in the admin panel in: Site settings / Custom resource properties). E.g. for a custom property 'distance to sea', this would be prop_res_distance_to_sea (where '_' replaces all space characters). If you want to look for values greater or less than a specific number (e.g. hotels with specific max. distance to sea), prefix the value with one of the following operators: <, >, <=, >= e.g. prop_res_distance_to_sea = <500. On the other hand, the [inlcude] prefix finds values that include the requested text, e.g. 'prop_res_desc = [include]find me'.
ppp_gps_coords_radius string optional
If you want to do a geolocation search (see Q281
for more about this), you must pass the distance from a point using this parameter (use the 'm' suffix to indicate if the distance is in miles, for kilometers use the 'km' suffix or no suffix at all, just a float) and you should set the coordinates of the search point (latitude followed by a comma and then longitude in decimal degrees, e.g. 46.17,8.80) using the parameter prop_res_gps_coords (if the coordinates of the resources should be used) or prop_cal_gps_coords (if the coordinates on the site level should be used -- only for metasite api keys). Only the results within specified distance from the given point will be returned. Additionally the distance in kilometers will be returned for each result ('distance' key).
sort string optional
Sort criterium. One of: resname (resource name), site (site ID), location, prop_res_xyz (sorted by one of the resource-specific properties defined in the admin panel in: Site settings / Custom resource properties). E.g. for a custom property 'distance to sea', this would be prop_res_distance_to_sea (where '_' replaces all space characters)
site_id int optional
If using an API key for a meta site, you can limit the results to a single site ID.
version float optional
you can optionally specify the version of the API that you're using. Use the value of latest or simply skip this parameter to use the latest API version. The latest version is: 1
language string optional
by specifying a 2-letter (ISO 639-1) language code (all capital letters e.g. EN, DE, FR, ES, IT) you can change the language of the text values returned
api_key string required
your API key - Click here to get your key
. If your API key uses a hash key, you must also include the parameters hash_key and hash_timestamp
Total number of resources. Note: this can be greater than the number of resources returned because of the max. page size limit set to 100.
Max. page number (page numbers are zero-based).
Array of resources. Each item is a named array with one or more of the following keys (depending on the specified detail_level): id, name, quantity, site_id, confirmation_type, unit_price, currency, category, published, min_rental_time, max_rental_time, min_time_between_rentals, min_hours_to_rental, max_days_to_rental, unit_names, resource_admin_id, resource_admin_email, resource_admin_name, properties (array of all resource-specific properties -- name => value -- defined in the admin panel in: Site settings / Custom resource properties), photos (array of photos containing following keys: id, path, title). For metasites, site information is also returned (site_id and site_name).
Click here for a PHP sample which you can embed into your webpage
Click here to test this function in the API playground.