<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?enunciate-assumed-base-uri https://api.upright-music.com/api/?>
<wadl:application xmlns:wadl="http://wadl.dev.java.net/2009/02" xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <wadl:doc xmlns:enunciate="http://enunciate.webcohesion.com/" enunciate:generatedBy="Enunciate-2.0"/>
  
  <wadl:grammars>
    <wadl:include href="ns0.xsd"/>
  </wadl:grammars>

  <wadl:resources base="https://api.upright-music.com/api/">

    <wadl:resource path="territories">
      <wadl:method name="GET">
        <wadl:doc><![CDATA[Returns all territories optionally filtered by one or more available
filtering options.]]></wadl:doc>
        <wadl:request>
          <wadl:param name="contains" style="query">
            <wadl:doc><![CDATA[a <code>String</code> holding a value which at least one
of the most representative fields for a territory must contain.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="parentTerritoryIds" style="query">
            <wadl:doc><![CDATA[a <code>String</code> holding one or more
parent territory ids (separated by comma) for which corresponding
territories are to be returned.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="territoryIds" style="query">
            <wadl:doc><![CDATA[a <code>String</code> holding one or more territory
ids (separated by comma) for which corresponding territories are to be
returned.]]></wadl:doc>
          </wadl:param>
        </wadl:request>
        <wadl:response status="500">
          <wadl:doc><![CDATA[An error occured.]]></wadl:doc>
        </wadl:response>
        <wadl:response status="200">
          <wadl:doc><![CDATA[]]></wadl:doc>
          <wadl:representation mediaType="application/xml" element="territory"/>
        </wadl:response>
      </wadl:method>
    </wadl:resource>

    <wadl:resource path="tracks">
      <wadl:method name="GET">
        <wadl:doc><![CDATA[Returns tracks optionally filtered by one or more available filtering
options.]]></wadl:doc>
        <wadl:request>
          <wadl:param name="X-Extended-Entities" style="header">
            <wadl:doc><![CDATA[a <code>boolean</code> indicating if
collections are to be returned along with the requested tracks.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="X-Territory-ID" style="header">
            <wadl:doc><![CDATA[a <code>String</code> holding a territory id
for which corresponding relationships are to be returned. Ignored if
<b>territoryId</b> query parameter is provided.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="albumIds" style="query">
            <wadl:doc><![CDATA[a <code>String</code> holding one or more album ids
(separated by comma) for which corresponding tracks are to be returned.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="applyUndistributionRules" style="query">
            <wadl:doc><![CDATA[a <code>boolean</code> indicating if
distribution rules are to be applied. This parameter has no effect unless
the requesting user has the permission to request non-published tracks.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="distribute" style="query">
            <wadl:doc><![CDATA[a <code>boolean</code> indicating if only distributed
or non-distributed tracks are to be returned. This parameter has no
effect unless the requesting user has the permission to request
non-published tracks.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="excludeLibraryIds" style="query">
            <wadl:doc><![CDATA[a <code>String</code> holding one or more library
ids (separated by comma) for which corresponding tracks are to be excluded.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="libraryBundleId" style="query">
            <wadl:doc><![CDATA[a <code>String</code> holding a library bundle id
for which corresponding relationships are to be returned.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="libraryIds" style="query">
            <wadl:doc><![CDATA[a <code>String</code> holding one or more library ids
(separated by comma) for which corresponding tracks are to be returned.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="limit" style="query">
            <wadl:doc><![CDATA[an <code>int</code> holding the number of tracks to be
returned. The absolute maximum is 2500.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="offset" style="query">
            <wadl:doc><![CDATA[an <code>int</code> holding the position in the dataset of
a particular track. By specifying offset, you retrieve a subset of tracks
starting with the offset value. Offset normally works with
<code>limit</code>, which determines how many tracks to retrieve starting
from the offset.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="sort" style="query">
            <wadl:doc><![CDATA[a <code>String</code> holding one or more pairs (separated by
comma) of field and direction to sort by. Each pair's field and direction
must be separated by a colon : <code>Title:desc,Number:asc</code>, except
for <code>Random</code> which can be provided as field name only.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="statuses" style="query">
            <wadl:doc><![CDATA[a <code>String</code> holding the statuses (separated by
comma) for which corresponding tracks are to be returned. This parameter
has no effect unless the requesting user has the permission to request
non-published tracks.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="territoryId" style="query">
            <wadl:doc><![CDATA[a <code>String</code> holding a territory id which
tracks must be available in.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="trackIds" style="query">
            <wadl:doc><![CDATA[a <code>String</code> holding one or more track ids
(separated by comma) for which corresponding tracks are to be returned.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="trackParentIds" style="query">
            <wadl:doc><![CDATA[a <code>String</code> holding one or more track ids
(separated by comma) for which corresponding track versions are to be
returned.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="versionTypes" style="query">
            <wadl:doc><![CDATA[a <code>String</code> holding one or more version
types (separated by comma) for which corresponding tracks are to be
returned.]]></wadl:doc>
          </wadl:param>
        </wadl:request>
        <wadl:response status="404">
          <wadl:doc><![CDATA[The provided track id does not correspond to an available track.]]></wadl:doc>
        </wadl:response>
        <wadl:response status="500">
          <wadl:doc><![CDATA[An error occured.]]></wadl:doc>
        </wadl:response>
        <wadl:response status="200">
          <wadl:doc><![CDATA[]]></wadl:doc>
          <wadl:representation mediaType="application/xml" element="track"/>
        </wadl:response>
      </wadl:method>
    </wadl:resource>

    <wadl:resource path="tracks/search">
      <wadl:method name="GET">
        <wadl:doc><![CDATA[<![CDATA[ <p>
Search for tracks</p>

<p>
This resource expose search functionality for tracks. A search can be
based on text and/or filters. A basic search for the phrase
<strong>Rock</strong> can be carried out with the following query :
</p>

<p>
<code>track/search?phrase=rock</code>
</p>

<p>
The above query will return all tracks which somehow matches the phrase
rock. The returned search result will also hold one or more applicable
search filters. These search filters can be found in
<code>applicableSearchFilterGroups</code>. To filter the search results
by the genre <strong>Country Rock</strong>, the original query could be
modified to the following narrowed query :
</p>

<p>
<code>tracks/search?phrase=rock&track_genre_f=Country%20Rock</code>
</p>

<p>
The search can be narrowed even further by adding more filters. Each
filter field may be used multiple times:
</p>

<p>
<code>/tracks/search?phrase=rock&track_genre_f=Country%20Rock&track_genre_f=Ambient</code>
</p>

<p>
You may also search for tracks by providing a filename:
</p>

<p>
<code>/tracks/search?phrase=_UPRIGHT_STR_006_002_Got_A_Finger_(Main)</code>
</p>]]></wadl:doc>
        <wadl:request>
          <wadl:param name="X-Entities" style="header">
            <wadl:doc><![CDATA[a <code>boolean</code> indicating if entities should
be returned along with the response. If set to <b>false</b>
only entity ids will be returned.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="X-Extended-Entities" style="header">
            <wadl:doc><![CDATA[a <code>boolean</code> indicating if extended
entities should be returned along with the response.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="X-Territory-ID" style="header">
            <wadl:doc><![CDATA[a <code>String</code> holding a territory id
for which corresponding relationships are to be returned. Ignored if
<b>territoryId</b> query parameter is provided.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="applyUndistributionRules" style="query">
            <wadl:doc><![CDATA[a <code>boolean</code> indicating if
distribution rules are to be applied. This parameter has no effect unless
the requesting user has the permission to request non-published tracks.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="distribute" style="query">
            <wadl:doc><![CDATA[a <code>boolean</code> indicating if tracks should be
filtered by distribution status.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="excludeLibraryIds" style="query">
            <wadl:doc><![CDATA[a <code>String</code> holding a comma separated
list of library codes for which corresponding tracks are to be excluded.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="groupByAlbum" style="query">
            <wadl:doc><![CDATA[a <code>boolean</code> indicating of tracks which
appear on the same results page should be grouped by album. This affects
the score slightly, but only very little since the grouping takes place
only within a single page.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="libraryBundleId" style="query">
            <wadl:doc><![CDATA[]]></wadl:doc>
          </wadl:param>
          <wadl:param name="maxSuggestionsPerCategory" style="query">
            <wadl:doc><![CDATA[an <code>int</code> holding the maximum
number of suggestions which will be returned for each applicable filters
category.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="mlt" style="query">
            <wadl:doc><![CDATA[a <code>boolean</code> indicating if a 'more like this' search
should be carried out. This requires that the provided phrase is a <code>
UUID</code> which holds a seed track id.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="page" style="query">
            <wadl:doc><![CDATA[an <code>int</code> holding the page number which is to be
returned.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="pageSize" style="query">
            <wadl:doc><![CDATA[an <code>int</code> holding the number of entities which
are to be returned for the page.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="partialPhraseMatch" style="query">
            <wadl:doc><![CDATA[a <code>boolean</code> indicating if all words
in the provided phrases must match.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="phrase" style="query">
            <wadl:doc><![CDATA[a <code>String</code> holding a search phrase. You may also
provide a filename such as
<code>_UPRIGHT_STR_002_021_Mister_Banuska_(Main).MP3</code>. Required.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="relevantSuggestionsPerCategoryOnly" style="query">
            <wadl:doc><![CDATA[a <code>boolean</code>
indicating if a threshold should be calculated and applied to filter out
filters which may not be relevant.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="sort" style="query">
            <wadl:doc><![CDATA[a comma separated <code>String</code> holding the fields
which results are to be sorted by. Each field is a combination of the
field name and the sort direction (<code>asc</code> or
<code>desc</code>), such as <b>track_title:asc</b>. Respected fields are
<code>track_alternativetitle</code>, <code>track_bpm</code>,
<code>track_created</code>, <code>track_duration</code>
<code>track_number</code>, <code>track_pd</code>,
<code>track_title</code>, <code>track_type</code>,
<code>track_version</code>, <code>track_year</code>,
<code>album_number</code>, <code>album_title</code>
<code>library_code</code>, <code>library_name</code>]]></wadl:doc>
          </wadl:param>
          <wadl:param name="statuses" style="query">
            <wadl:doc><![CDATA[a comma separated <code>String</code> holding one or more
statuses which results are to be filtered by.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="territoryId" style="query">
            <wadl:doc><![CDATA[a <code>String</code> holding a territory id which
tracks must be available in.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="trackTitleMustContainPhrase" style="query">
            <wadl:doc><![CDATA[a <code>boolean</code> indicating if
the track title field must contain the provided <b>phrase</b> (if
provided).]]></wadl:doc>
          </wadl:param>
          <wadl:param name="track_*_f" style="query">
            <wadl:doc><![CDATA[a <code>String</code> holding a value which the given field
is to be filtered by. Available fields can be found in
<code>applicableSearchFilterGroups</code> for any given search result.
For facets on integers ranges (e.g. duration and bpm) the value may also
be arbitrary min and max values separated by comma (e.g. "50,60").]]></wadl:doc>
          </wadl:param>
          <wadl:param name="versionTypes" style="query">
            <wadl:doc><![CDATA[a comma separated <code>String</code> holding the
version types which are to be returned.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="versions" style="query">
            <wadl:doc><![CDATA[a <code>boolean</code> indicating if versions are to be
returned. If this argument is set to <b>false</b>, only main and
alternative versions will be returned. <b>Deprecated</b>.]]></wadl:doc>
          </wadl:param>
        </wadl:request>
        <wadl:response status="301">
          <wadl:doc><![CDATA[The request was redirected to the search API.]]></wadl:doc>
        </wadl:response>
        <wadl:response>
          <wadl:doc><![CDATA[]]></wadl:doc>
          <wadl:representation mediaType="application/xml" element="trackSearchResult"/>
        </wadl:response>
      </wadl:method>
    </wadl:resource>

    <wadl:resource path="tracks/{trackId}/versions">
      <wadl:method name="GET">
        <wadl:doc><![CDATA[Returns track versions optionally filtered by one or more available
filtering options.]]></wadl:doc>
        <wadl:request>
          <wadl:param name="X-Extended-Entities" style="header">
            <wadl:doc><![CDATA[a <code>boolean</code> indicating if
collections are to be returned along with the requested tracks.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="distribute" style="query">
            <wadl:doc><![CDATA[a <code>boolean</code> indicating if only distributed
or non-distributed tracks are to be returned. This parameter has no
effect unless the requesting user has the permission to request
non-published tracks.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="sort" style="query">
            <wadl:doc><![CDATA[a <code>String</code> holding one or more pairs (separated by
comma) of field and direction to sort by. Each pair's field and direction
must be separated by a colon : <code>Title:desc,Number:asc</code>, except
for <code>Random</code> which can be provided as field name only.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="statuses" style="query">
            <wadl:doc><![CDATA[a <code>String</code> holding the statuses (separated by
comma) for which corresponding tracks are to be returned. This parameter
has no effect unless the requesting user has the permission to request
non-published tracks.]]></wadl:doc>
          </wadl:param>
          <wadl:param name="versionTypes" style="query">
            <wadl:doc><![CDATA[a <code>String</code> holding one or more version
types (separated by comma) for which corresponding tracks are to be
returned.]]></wadl:doc>
          </wadl:param>
        </wadl:request>
        <wadl:response status="404">
          <wadl:doc><![CDATA[The provided track id does not correspond to an available track.]]></wadl:doc>
        </wadl:response>
        <wadl:response status="500">
          <wadl:doc><![CDATA[An error occured.]]></wadl:doc>
        </wadl:response>
        <wadl:response status="200">
          <wadl:doc><![CDATA[]]></wadl:doc>
          <wadl:representation mediaType="application/xml" element="track"/>
        </wadl:response>
      </wadl:method>
      <wadl:param name="trackId" style="template">
        <wadl:doc><![CDATA[a <code>String</code> holding an id representing the track
for which versions are to be returned. The track corresponding to the
track id will not be part of the returned track versions.]]></wadl:doc>
      </wadl:param>
    </wadl:resource>
  </wadl:resources>
</wadl:application>
