- Print
- DarkLight
Summary
Discovery API is used for searching attractions, venues, events and classifications. We can even fetch detailed information of any attraction or venue or event, by passing its identifier. These examples are for Android developers. The examples are in Kotlin.
Features
List of APIs provided by DiscoveryAPI
- Attractions Search
- Venues Search
- Event Search
- Event Details
- Attraction Details
- Venue Details
DiscoveryAPI Setup
val tmDiscoveryAPI = TMDiscoveryApi.Builder()
.apikey("<API KEY HERE>")
.market("<TMMarketDomain..>")
.build()
Accessing Discovery service
After creating the TMDiscoveryAPI instance as you just did during the setup, you'll now have access to different services pertaining to attractions, venues or events from this one instance to satisfy your needs as shown here:
fun getAttractionService(): DiscoveryAttractionService = tmDiscoveryAPI.getAttractionService()
fun getVenueService(): DiscoveryVenueService = tmDiscoveryAPI.getVenueService()
:::(Info) (Only for MFX Venue Details):::
fun getMFXVenueService(): MFXDiscoveryVenueService = mfxDiscoveryVenueService
fun getEventService(): DiscoveryEventService = tmDiscoveryAPI.getEventService()
Search methods with Examples
- Attractions Search
To get a list of attractions, you'll have to use the
getAttractionSearchResults()method from theDiscoveryAttractionServiceand pass in the following:
-DiscoveryAttractionSearchCriteriaobject with the requiredkeywordsFilterparameter
-TMMarketDomainrepresenting the market you're searching in
Example:
val params = GetDiscoveryAttractionSearchParams(
market = <TMMarketDomain..>,
discoveryAttractionSearchParams = DiscoveryAttractionSearchCriteria(
keywordsFilter = <Keyword to search...>
)
)
val result = getAttractionService().getAttractionSearchResults(params)
- Venues Search
To get a list of venues, you'll have to use the
getSearchResults()method from theDiscoveryVenueServiceand pass in the following:
-DiscoveryVenueSearchCriteriaobject with the requiredkeywordsFilterparameter
-TMMarketDomainrepresenting the market you're searching in
Example:
val params = GetDiscoveryVenueSearchParams(
market = <TMMarketDomain..>,
discoveryVenueSearchParams = DiscoveryVenueSearchCriteria(
keywordsFilter = <Keyword to search...>
)
)
val result = getVenueService().getSearchResults(params)
- Events Search
To get a list of events, you'll have to use the
getEventList()method from theDiscoveryEventServiceand pass in the following:
-TMDiscoveryQueryBuilderbuilder object that has a slew of parameters to cater to your needs
Example:
val queryBuilder = TMDiscoveryQueryBuilder.Builder()
.keyword(<Event Query>)
.pageSize(<Page size>)
.sortBy(<TMDiscoveryQueryBuilder.SortBy...>)
.build()
val result = getEventService().getEventList(queryBuilder)
- Event Details
To get details for specific event, you'll have to use the
getEventDetailsResult()method from theDiscoveryEventServiceand pass in the following:
-eventIdis the id of the event you're searching for
Example:
val result = getEventService().getEventDetailsResult(eventId)
- Attraction Details Search
To get details for a specific attraction, you'll have to use the overloaded
getAttractionDetailsResult()method from theDiscoveryAttractionServiceand pass in the following:
-attractionIdis the id of the attraction you're searching for
Example:
val result = getAttractionService().getAttractionDetailsResult(attractionId)
- Venue Details Search
To get details for a specific venue, you'll have to use the
getVenueDetails()method from theDiscoveryVenueServiceand pass in the following:
-venueIdis the id of the venue you're searching for
Example:
val result = getVenueService().getVenueDetails(venueId)
To get details for a specific venue on MFX markets, you'll have to use the
getMFXVenueService()method from theMFXDiscoveryVenueServiceand pass in the following:
-venueCodeis the id of the venue you're searching for
-systemIdis the venue system key
Example
This is a Belgium URL: https://www.ticketmaster.be/venue/vorst-nationaal-forest-national-vorst-tickets/fna/107
The venue code is 107 and system id is fna
val mfxVenueParams = MFXVenueInfoParams(
venueCode = "107",
systemId = "fna",
market = TMMarketDomain.BE
)
getMFXVenueService().getVenueDetailsResult(mfxVenueParams)
