Extending the rest api with metadata information and more

Registered by Lucio Torre

This blueprint has been superseded. See the newer blueprint "Ubuntu One API Roundtable" for updated plans.

Now that we have a nice Path based RESTful API for file access clients will be able to access their files more directly and quickly using paths. The next step in providing access to files is by providing ways to access/find files based on meta information about the files.

Also the place to discuss and propose more extensions and usability improvements to our files api.

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
Lucio Torre
Definition:
Superseded
Series goal:
None
Implementation:
Unknown
Milestone target:
None
Completed by
Lucio Torre

Related branches

Sprints

Whiteboard

---- Music Metadata ----
We may want to create "Libraries" for accessing files based on metadata. A natural place to start may be music files since we already have this

For music we introduce the Music Library based on music tagging information. Here is a suggested REST API:

First a generic way of getting music files:

GET /Libraries/Music/Artists
GET /Libraries/Music/Albums
GET /Libraries/Music/Songs

---To find artist with name like %blue%
GET /Libraries/Music/Artists?name=blue

--To find albums for a specific Artist
GET /Libraries/Music/Albums?artist=Blue%20October

--To find songs on a specific Album and Artist
GET /Libraries/Music/Songs?artist=Blue%20October&album=Foiled

To enhance the experience, music metadata should be included files in the responses.
For example:

GET <path to file>?include_meta=music

Response:
{
   ... existing file info...
   "music_metadata": {...}
}

---- File Tagging ----

Another suggestion is to allow users to tag files and then GET them based on the tags.

-- tagging a file
PUT <path to file> {"tags":"cruise,mom"}
PUT <path to file> {favourite: True}

-- finding them.
GET /Library/Tagged/favourites
GET /Library/Tagged/?tags=cruise,mom

Note in the examples above, PUT uses <path to file>. This would be the existing path to a file node defined by the RESTful Storage API spec.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.