Listing Events from Multiple Venues
#
OverviewYour solution may require pulling and listing events from multiple venues. Rather than making an API call per venue, you can recieve all events at the same time through a singular request. The resulting series of events can then be used to link directly to the ParkWhiz website, render the associated location map or list view within the widget, or start a transactional flow using the API.
This method gives you the most control of information presented, including the ability to search and filter results.
#
RequirementsTo start, you'll need your API credentials, provided to you by your account manager, as well as a list of Arrive venue IDs from which you'd like to pull event data.
You'll need a beginner level of API knowledge to follow this walkthrough. All code examples will be provided in cURL format.
#
Get Events#
Base EndpointAs outlined in the GET /events endpoint, events can be queried by a comma-separated list of Arrive venue IDs. To retrieve a list of all upcoming events for a group of venues, call the following endpoint:
To list events for sports venues in Detroit (in this case Comerica Park, Little Caeser's Arena, and Ford Field), you'd call:
Which would return something similar to:
#
Additional OptionsAdditional options can be added to this query for further customization. Common additions include:
- Searching by event name (removing all non-ASCII characters)
- Filtering/sorting by date/time in ISO 8601 format
- Including the URL to the event's results page on ParkWhiz
- Including events with TBD times
- Managing pagination (as outlined in the Pagination section of the Developer Docs)
A call with these additional options is shown below.
#
Searching by Event NameIncluding text-based search makes it easier for your users to find the events they're looking for. Fortunately, searching is available via the API.
Pre-Parse your Query
Only ASCII characters are supported in text search. It's recommended to pre-parse your query for any invalid characters. (Regex: /[^\x00-\x7F]/
)
To filter results with a query (in this case, by "Detroit Tigers"), you'd call:
Which would return something similar to:
#
Filtering/Sorting by Date/TimeIf you'd like to display events within a selected period, you can call the api with time filters.
To filter results by a start and end time, you'd call:
Which would return something similar to:
#
Including the URL to the Event's Results PageRather than calling an API or rendering a widget, you can create an event linkoff to ParkWhiz.com.
To display events with their site URL, you'd call:
Which would return something similar to:
#
Including TBD EventsTBD Events are events containing estimated, rather than concrete, dates in the future. Examples include playoff games and event postponements.
To display TBD events, you'd call:
Which would return something similar to:
#
Managing PaginationThe API returns a maximum of 100 results per API call. If your request has more than 100 results, or you'd like to limit the number of responses per call, you'll need to use Pagination.
To limit the events call to 3 responses, and display the first page of results, you'd call:
Which would return something similar to:
#
Use the Event ID#
Linking to ParkWhiz WebIncluding the URL via the event:site_url
field will provide a direct link to the event's page on ParkWhiz.com - all you need to do is add the domain from the environment you made the call in front of the returned path.
Example:
With a return of
"site_url": "/madison-square-garden-parking/knotfest-roadshow-slipknot-a-day-to-remember-underoath-1045919/"
,
You can link to
#
Rendering the WidgetYou can use the returned event ID from the API response to render a location map or list view within the widget. All you'll need is the destination-event-id
parameter and a map
or location-list
UI component.
With a return of
"id": 1045919
,
Your widget URL would look like
#
Starting the Transactional API FlowSimilar to rendering the widget, you can start a transactional API flow using the event ID within the response. To do so, you'll pass the event_id
as a GET /quotes query parameter. From the returned quotes, you can preview and book parking as per the standard transactional flow.
With a return of
"id": 1045919
,
Your quotes request would look like