API - Planyo Web Services - list_resources

Sie sind hier: Planyo » Hilfe » API » list_resources

list_resources (version 1)

Description:

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.

Input:

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.
res_filter_name string optional
Optional resource filter name (in form: prop_res_xxx, see Q205 for the full list of resource filters available for your planyo site). Together with res_filter_value, these parameters work just just the resource filter in advanced integration and let you only get a subset of resources.
res_filter_value string optional
Exact value of the custom resource property to be used together with res_filter_name as the resource filter. Note: instead of using this parameter, you can also use res_filter_value_inc which looks for values of the custom resource property which include the requested text. Using res_filter_value will only find exact matches.
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.

Output:

resource_count int
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 int
Max. page number (page numbers are zero-based).
resources array
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).

Sample:

Click here for a PHP sample which you can embed into your webpage

API playground:

Click here to test this function in the API playground.