API - Planyo Web Services - list_vacations

Estás aquí: Planyo » Ayuda » API » list_vacations

list_vacations

Description:

Lists all vacations within specified time range. You can specify either site_id or resource_id to get site-wide vacations in the first case and resource-specific vacations in the second case. Pass resource_id=all and include_site_vacations to list all vacations.

Input:

start_time DateTime required
Start of time period
end_time DateTime required
End of time period
resource_id string optional
If you specify a resource ID, only vacations for this resource will be listed. Use the special value all if you'd like to list vacations for all resources. If you combine this value with include_site_vacations=true, then both resource-specific and site-wide vacations will be returned.
site_id int optional
If using a metasite api key, setting site_id and not specifying any resource_id will list global vacations for a site. If you specified a resource_id you may leave this parameter empty.
type int required
You can only request vacations of a specific type. Use the value of 2 for vacations imported from Google calendar, 3 for iCal-imported vacations, 1 for vacations entered on the availability page or leave this empty to get regular vacations. Use all to list vacations of all types.
unit_assignment string optional
If you wish, you can only limit the vacations returned to a specific unit assignment. Vacations with no unit assigned or assigned to a different unit will not be returned in such case. Alternatively, if you set this to unassigned, only vacations with no unit assignment will be returned.
include_site_vacations bool optional
When true, global vacations will be included in the results. When false, only resource vacations will be returned.
vacation_recurrence_type string optional
One of the values: one-time (default, only one-time vacations are returned), recurring (only vacations repeated everyday, every week, every month and every year are returned), all (vacations of all types are returned).
expand_recurring bool optional
When true, reccuring vacations will be expanded in the specified period. When false, the vacations will be returned in the compact form.
page int optional
Zero-based page number. The default is 0. Each page lists max 5000 vacations. Note: you can change the page size (max 5000) with the page_size parameter
method string required
must be set to list_vacations
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:

results array
Array whose items are named arrays with the following keys: vacation_id, start_time, end_time, comment, quantity (integer or NULL for site-wide vacations), type (NULL for normal vacations, 1 for vacations entered on the Availability page, 2 for vacations imported from Google calendar), resource_id, valid_from, valid_to (specified when vacation validity is limited to a specific period), period_type (vacation recurrence type: 1 - one-time, 2 - repeated everyday, 3 - repeated every weekday, 4 - repeated every month, 5 - repeated every year), weekday (for the recurrence type 'every weekday', this is the day of the vacation), start_month_day, end_month_day (for the recurrence type 'every month' and 'every year', this is the start and end day of the vacation), start_month, end_month (for the recurrence type 'every year', this is the start and end month of the vacation).

API playground:

Click here to test this function in the API playground.