API - Planyo Web Services - get_simplified_daily_restrictions

Ti trovi qui: Planyo » Aiuto » API » get_simplified_daily_restrictions



Use this function if you need to get daily restrictions for a range of dates (max 2 years). This function is mostly used for accommodations in order to convert the restrictions defined in seasonal settings and in time-related settings to restrictions understood by channel managers. Note that Planyo is capable of having more restrictions which will not be returned by this function, e.g. the ones defined in Pricing Manager checking for a wide number of conditions (using the UNAVAILABILITY MESSAGE values instead of prices).


resource_id int optional
ID of the resource. Pass null if you want info for all resources to be returned. In this case and if using a metasite API key, you'll need to pass the site id in the site_id parameter.
site_id int optional
Required only for metasite API keys and when resource_id is null. Otherwise skip this parameter.
start_date DateTime required
Start date of the period
end_date DateTime required
End date of the period
return_blocked_days bool optional
Set to true if the output should include the restriction 'is_blocked' for the blocked periods. Important: blocked periods are only a part of unavailable periods. Use the function get_resource_usage to get availability information. Blocked periods are simply vacations defined for the entire site or for all units of the resource on the Resource vacations page. Vacations added for single time units on the Availability calendar page will not be treated as blocked days.
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.


restrictions array
Resource restrictions for the desired period. For each returned resource, a list of arrays with the following keys is returned representing grouped periods of identical restrictions: from (date), to (date), min (float) - minimum rental time expressed in hours, e.g. 48 means 2 days, max (float) - maximum rental time expressed in hours, or NULL if no maximum stay restriction is set, is_blocked - set to true when the resource is blocked, see the description of the input parameter return_blocked_days for more info, start_weekday_flags, end_weekday_flags (int) - (ORed flags specifying days when rentals can start and end: from 1 = 2^0 = Sunday to 64 = 2^6 = Saturday -- example: when equals 3 = 2+1 = Monday + Sunday)

API playground:

Click here to test this function in the API playground.