Scala SDK for Ticketmaster API
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

Ticketmaster API: SDK for Scala

Build Status Coverage Status Download

For more detailed information about the API and to get your API key head here. This SDK supports Discovery v2.

Dependency

libraryDependencies ++= Seq(
  "com.ticketmaster.api" %% "discovery-scala" % "0.1.3"
)

Usage

import com.ticketmaster.api.discovery._

val api = Discovery("your-api-key")

API calls are non-blocking so require that there is a scala.concurrent.ExecutionContext implicitly available.

All take a case class representing the criteria for that call. For example, search events takes a com.ticketmaster.api.discovery.SearchEventsRequest on which you can set your criteria.

import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future

import com.ticketmaster.api.discovery.domain._
import com.ticketmaster.api.Api._

val criteria = SearchEventsRequest(keyword = "coachella", size = 5)

val pendingResponse: Future[PageResponse[Events]] = api.searchEvents(criteria)

See docs for full list of criteria and resources they relate to.

Rate limit details are provided in every response in com.ticketmaster.api.discovery.RateLimits. Search API calls will return paging details in com.ticketmaster.api.discovery.Page as part of the result.

Error handling

This library piggy-backs on scala.concurrent.Future semantics for handling errors. Exceptions can be handled in the recover combinator.

Http client

The default http client is dispatch. It is possible to use a different http client by extending com.ticketmaster.api.discovery.http.Http and overriding method http in your own instance of com.ticketmaster.api.discovery.HttpDiscoveryApi.

Outstanding

  • Expose _links and _embedded for each resource.
  • Remove boilerplate code transforming criteria to http request.
  • Stop using Future semantics for recoverable errors.
  • Allow pluggable json parser. Currently using argonaut.

Build notes

This README.md is generated by tut. Make changes to src/main/tut/README.md and run sbt tut to generate this file.

Release

  • Ensure bintray credentials exists in ~/.bintray/.credentials.
  • sbt release