TIAPI: Difference between revisions

From tango.info wiki
Jump to navigation Jump to search
https://code.google.com/p/xml2json-xslt/
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 2: Line 2:
TIAPI = TI-API = [[API]] for [[tango.info]]
TIAPI = TI-API = [[API]] for [[tango.info]]


Ideally this will be a [http://en.wikipedia.org/wiki/Representational_state_transfer RESTful] API likely requiring a HTTP GET method to query the database.  This will provide a dynamic way to interactively query the [[tango.info]] database.


==Reading==
Ideally this will be a [http://en.wikipedia.org/wiki/Representational_state_transfer RESTful] API.  It will provide the ability to list collections and retrieve tracks from a collections.  The object of the API is to provide a dynamic way to read from the [[tango.info]] library.
The API should provide the ability to return a query search of the database.


===Query Fields===
* All API quries are sent to a base URI (i.e. http://tango.info/API/ )
* Only GET methods are used as the API isn't planned to support modifying the database.
* All responses are a single internet media type (standard for the site is still undecided).
* Any response making reference to related resources are hypertext links.


Ideally the query parameters would be customizable to the search likely being able to include:


* Title
==Listing Collections==
* Orchestra
* Album
* TINT
* ...


===Return Format===
Any Internet media format would work but JSON would be best given the human readability and open standard format.


* HTTP GET method is sent from the user to a collection URI (i.e. http://tango.info/API/artist/D'Arienzo/track_name/El Flete/ ).
* The tango.info library is quired for the specified collection.
* A internet media type object is created matching the collection requested containing:
** Track Name
** Orchestra
** Artist
** Vocalist
** Album
** TINP as a hypertext link
** Year
** Duration
** TINT as a hypertext link
** (possibly more as needed)
* An HTTP response is sent back to the user containing the collection results.
==Retrieving A Track's Meta Info==
* HTTP GET method is sent from the user to a track URI (i.e. http://tango.info/API/TINT/00743217137229-1-4 ).
* The tango.info library is quired for the specified track.
* A internet media type object is created containing all the tracks meta information.
* An HTTP response is sent back to the user containing the collection results.
==URI Structure==
The structure of the URI could take on many forms:
* Parsed as a directory structure:
** http://tango.info/API/artist/D'Arienzo/track_name/El Flete/
* Parsed as query string:
** http://tango.info/API?artist=Diaz&track_name=Embrujo
==Return Format==
Any Internet media format works as a return format.  The key is that it is a standard form so the user knows what to expect.  If there is a need to the output to be in a different format there are many conversion tools to do this (i.e. https://code.google.com/p/xml2json-xslt/ )
===Options===
* csv?
* csv?
* xml?
* xml - could be used for the whole site
* json?
* json?
Transformations:
* https://code.google.com/p/xml2json-xslt/
==Writing==
Not planned.

Latest revision as of 2014-02-09T21:35:05

Overview

TIAPI = TI-API = API for tango.info


Ideally this will be a RESTful API. It will provide the ability to list collections and retrieve tracks from a collections. The object of the API is to provide a dynamic way to read from the tango.info library.

  • All API quries are sent to a base URI (i.e. http://tango.info/API/ )
  • Only GET methods are used as the API isn't planned to support modifying the database.
  • All responses are a single internet media type (standard for the site is still undecided).
  • Any response making reference to related resources are hypertext links.


Listing Collections

  • HTTP GET method is sent from the user to a collection URI (i.e. http://tango.info/API/artist/D'Arienzo/track_name/El Flete/ ).
  • The tango.info library is quired for the specified collection.
  • A internet media type object is created matching the collection requested containing:
    • Track Name
    • Orchestra
    • Artist
    • Vocalist
    • Album
    • TINP as a hypertext link
    • Year
    • Duration
    • TINT as a hypertext link
    • (possibly more as needed)
  • An HTTP response is sent back to the user containing the collection results.


Retrieving A Track's Meta Info

  • HTTP GET method is sent from the user to a track URI (i.e. http://tango.info/API/TINT/00743217137229-1-4 ).
  • The tango.info library is quired for the specified track.
  • A internet media type object is created containing all the tracks meta information.
  • An HTTP response is sent back to the user containing the collection results.


URI Structure

The structure of the URI could take on many forms:


Return Format

Any Internet media format works as a return format. The key is that it is a standard form so the user knows what to expect. If there is a need to the output to be in a different format there are many conversion tools to do this (i.e. https://code.google.com/p/xml2json-xslt/ )


Options

  • csv?
  • xml - could be used for the whole site
  • json?