The Ticketmaster .NET SDK contains projects with the implementation of easy access to API endpoints. For more detailed information about the API and to get your API key head here. This SDK supports Discovery v2.
The solution contains different projects
The implementation of interfaces, the clients, in sdk required to resolve ClientConfig
and pass them like a parameter into constructor. It have ConsumerKey
property what is the Consumer Key for ticketmaster api. And ApiRootUrl
what should be https://app.ticketmaster.com/discovery/
.
public interface IClientConfig
{
string ConsumerKey { get; }
string ApiRootUrl { get; }
}
var config = Substitute.For<IClientConfig>();
config.ConsumerKey.Returns("K1uJLzJ5mdt3oBKNSzjcEEEzxHuJJXiX-1");
config.ApiRootUrl.Returns("https://app.ticketmaster.com/discovery/");
var restClient = new RestClient(config.ApiRootUrl);
var eventsApiClient = new EventsClient(client, config);
var result = await _sut.SearchEventsAsync(new SearchEventsRequest());
The Discovery API can accept query parameters
for different endpoints. To allow pass this query parameters was created BaseQuery
which have QueryParameters
property.
For adding this parameters you just need create new instance of IDiscoveryApiRequest, IDiscoveryApiGetRequest interface. In this solution we have implementations for this interfaces. The SearchAttractionsRequest
, SearchClassificationsRequest
, SearchEventsRequest
, SearchVenuesRequest
classes. Use method AddQueryParameter
to add query properties, the rules described in Method description for Api. The Example for Search Events method is:
var request = new SearchAttractionsRequest();
request.AddQueryParameter(new KeyValuePair<QueryParameters, string>(key, value));
- Serhii Voznyi - Initial work
- serhiivoznyi@gmail.com
- Skype: serhiivoznyi
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details