Skip to content

nkiruthikkumar/ticketmaster-api-sdk-dot-net

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ticketmaster API: SDK for .NET

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.

Overview

The solution contains different projects

Usage

Setup IClientConfig

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; }
    }

Simple usage of EventsClient

  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 requests classes and BaseQuery class.

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));

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

SDK for Ticketmaster API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%