TIAPI: Difference between revisions

From tango.info wiki
Jump to navigation Jump to search
Greater detail as to what the proposed RESTful API should provide and how it might operate.
No edit summary
 
(One intermediate revision by the same user not shown)
Line 14: Line 14:




* 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"/ ).
* 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.
* The tango.info library is quired for the specified collection.
* A internet media type object is created matching the collection requested containing:
* A internet media type object is created matching the collection requested containing:
Line 33: Line 33:




* HTTP GET method is sent from the user to a track URI (i.e. http://tango.info/API/00743217137229-1-4 ).
* 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.
* The tango.info library is quired for the specified track.
* A internet media type object is created containing all the tracks meta information.
* A internet media type object is created containing all the tracks meta information.
Line 44: Line 44:
The structure of the URI could take on many forms:
The structure of the URI could take on many forms:
* Parsed as a directory structure:
* Parsed as a directory structure:
** http://tango.info/API/artist=D'Arienzo/track_name=El Flete/
** http://tango.info/API/artist/D'Arienzo/track_name/El Flete/
* Parsed as query string:
* Parsed as query string:
** http://tango.info/API?artist=Diaz&track_name=Embrujo
** http://tango.info/API?artist=Diaz&track_name=Embrujo




===Return Format===
==Return Format==





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?