Dates

Once you have dealt with pickup points for an activity, it's time to search for dates. The API does not show dates if they are no longer available due to closures or no vacancies - you only see what is available.

To search for dates in a specific activity, make the following request:

Copy
Copied
curl -X GET '{baseUrl}/activities/{activityUuid}/dates' \
-H 'X-Musement-Application: {applicationValue}' \
-H 'X-Musement-Version: 3.4.0' \
-H 'Authorization: Bearer {accessToken}'

For activities with pickup points, you must include the selected pickup in the request:

Copy
Copied
curl -X GET '{baseUrl}/activities/{activityUuid}/dates?pickup={pickupUuid}' \
-H 'X-Musement-Application: {applicationValue}' \
-H 'X-Musement-Version: 3.4.0' \
-H 'Authorization: Bearer {accessToken}'

The response contains an array of available dates, if any:

Copy
Copied
[
	{
		"day": "2021-06-13",
		"sold_out": false
	},
	[...]
	{
		"day": "2021-06-14",
		"sold_out": false
	},
	[...]
	{
		"day": "2021-06-15",
	"sold_out": false
	},
	[...]
]

You can limit results to specific date ranges using the date_from and date_to query parameters:

Copy
Copied
curl -X GET '{baseUrl}/activities/{activityUuid}/dates?date_from={startDate}&date_to={endDate}' \
-H 'X-Musement-Application: {applicationValue}' \
-H 'X-Musement-Version: 3.4.0' \
-H 'Authorization: Bearer {accessToken}'

If no date_from query parameter is present, today's date is used.

Pay attention to the dates you use for the query parameters. If you accidentally swap the start and end dates, the API will return a 400 error status:

Copy
Copied
{
	"code": "1440",
	"message": "End date cannot be before start date."
}

This can also happen when no date_from parameter is specified, but the date_to parameter contains a date before today's date.

Be aware of activity cutoff and confirmation times as well. Dates which fall into either of these time ranges will not be returned by the API.

In the example below, taken from the /activities/{activityUuid} endpoint, the activity doesn't have a confirmation time, but it does have a cutoff of seven days:

Copy
Copied
{
	[...]
	"max_confirmation_time": "P0D",
	"cutoff_time": "P7D",
	[...]
}

Setting date query parameters to dates within the cutoff_time period will result in an empty array response:

Copy
Copied
[]

For more information about the cutoff_time property, refer to the page dedicated to cutoff and confirmation times.

Copyright © TUI Musement. All rights reserved.