2011-04-05, 00:52
Tuesday, April 5th 2011:
With commit 774b8868ee59a1778ad5 to XBMC's master our JSON RPC API has undergone a huge transformation. Initially the main reason for this transformation was to make our implementation of JSON RPC compliant with the JSON RPC 2.0 specification (http://groups.google.com/group/json-rpc/...on-rpc-2-0). Our implementation was lacking support for client-side notifications, batch requests and the possibility to provide method parameters by-name (which already existed) OR by-position. The first two features have already been added a while ago but the implementation of by-position and by-name parameters took a bit longer but now it is ready for usage. But we didn't stop at just adding that functionality but we went a step further and are proud to announce that the JSONRPC.Introspect() method now returns a JSON Schema (http://tools.ietf.org/html/draft-zyp-json-schema-03) description of all available methods.
So what does all this mean for people using XBMC's JSON RPC API?
The following notes are meant for third-party developers using our old JSON RPC API and wish to migrate their applications to the improved JSON RPC API:
These are only the most important changes that affect a lot of methods. If anyone has any particular problems with a certain method, parameter or value and can't make any sense of the received error message they are always welcome to post their questions in our forums (http://forum.xbmc.org/showthread.php?tid=68263).
The next steps concerning XBMC's JSON RPC API will be to update the our wiki with the latest information, write and publish JSON Schema descriptions for notifications sent by XBMC and extend notifications with additional data which belong to the notification (e.g. the current position where movie playback has been stopped).
Monday, April 18th 2011:
Commit: 42298b8e06ffd32eab32
Saturday, April 23rd 2011:
Commit: 0c441d98cb24b7bd5473
Wednesday, June 8th 2011:
Commits: f678c5df079ff3df7d87, cfd17225d55e52da049b, 427599e02e13a5ec36aa, 28743c1647d6cdef84fe
Saturday, June 18th 2011:
Commit: 482cb54953c7a450a4ff
Wednesday, June 22th 2011:
Commits: 570da530375c22800743, d8e43a2a5399e7fe5ba9, fecb24254184c3b5eaae
Thursday, June 30th 2011:
Commits: 63cba75a76563554d10b
Friday, July 8th 2011:
Commits: 6bcd883be85f984308eb, 61bdb057b0149213a081
With commit 774b8868ee59a1778ad5 to XBMC's master our JSON RPC API has undergone a huge transformation. Initially the main reason for this transformation was to make our implementation of JSON RPC compliant with the JSON RPC 2.0 specification (http://groups.google.com/group/json-rpc/...on-rpc-2-0). Our implementation was lacking support for client-side notifications, batch requests and the possibility to provide method parameters by-name (which already existed) OR by-position. The first two features have already been added a while ago but the implementation of by-position and by-name parameters took a bit longer but now it is ready for usage. But we didn't stop at just adding that functionality but we went a step further and are proud to announce that the JSONRPC.Introspect() method now returns a JSON Schema (http://tools.ietf.org/html/draft-zyp-json-schema-03) description of all available methods.
So what does all this mean for people using XBMC's JSON RPC API?
- You're current implementations using the JSON RPC API probably won't work anymore (see further below for a list of the most important changes)!
- No more need to use custom json rpc implementations as our API is now compliant with JSON RPC 2.0 and therefore you can use standard implementations.
- No more uncertainty about what parameters a method expects and what it returns. The JSON Schema returned by JSONRPC.Introspect() contains detailed information about every parameter, it's value range, whether it's optional and about what a method will return.
- No more guessing about what an error message means. Based on the JSON Schema, which defines all method parameters, it is possible to return a detailed error message about what exactly is wrong with a received JSON RPC request.
- It is now possible to call certain methods using notifications (formerly called announcements). The advantage of call-by-notification is that the caller doesn't get a response at all (over HTTP it will be an empty response) so there's no need to wait for it.
- It is now possible to send multiple calls in a single request and receive all the responses in a single response. This can result in less data traffic and faster responses over HTTP.
The following notes are meant for third-party developers using our old JSON RPC API and wish to migrate their applications to the improved JSON RPC API:
- Disable compact JSON output from JSON RPC using the advanced settings (see http://wiki.xbmc.org/index.php?title=Adv...jsonrpc.3E)
- Call JSONRPC.Introspect() and take a close look at its result. It is a bit overwhelming at first but its structure is pretty much self-explaining. If you don't understand something you can check the JSON Schema specification (http://tools.ietf.org/html/draft-zyp-json-schema-03), the JSON Schema Service Descriptor specification (http://www.simple-is-better.org/json-rpc...iptor.html) or ask us (http://forum.xbmc.org/showthread.php?tid=68263).
- Only a few methods have been added and removed:
- AudioPlayer/VideoPlayer.GetTime() have been merged with AudioPlayer/VideoPlayer.GetTimeMS() to AudioPlayer/VideoPlayer.GetTime()
- AudioPlayer.Record() has been removed
- AudioLibrary.GetAlbumDetails() and AudioLibrary.GetSongDetails() have been added (but were already available in all nightly builds since Dharma)
- VideoLibrary.GetMovieDetails(), VideoLibrary.GetTVShowDetails(), VideoLibrary.GetEpisodeDetails() and VideoLibrary.GetMusicVideoDetails() have been added (but were already available in all nightly builds since Dharma)
- AudioPlayer/VideoPlayer.GetTime() have been merged with AudioPlayer/VideoPlayer.GetTimeMS() to AudioPlayer/VideoPlayer.GetTime()
- A lot of method parameters have changed. The most important change is that it isn't possible anymore to do "params": <some parameter value>. "params" must always be either an object or an array of parameter values. Further changes (no complete list) are:
- "start" and "end" parameters for methods returning an array of items have been moved into a "limits" object. So now you have to use "params": { "limits": { "start": 5, "end": 15 }, ...}
- "start", "end" and "total" return values for methods returning an array of items have been moved into a "limits" object
- parameters used for sorting of items have been moved into a "sort" object. Furthermore "ignorethe" has been renamed to "ignorearticle"
- AudioPlaylist/VideoPlaylist.GetItems(): "current", "playing" and "paused" have been moved into a "state" object
- AudioPlayer/VideoPlayer.GetTime(): Returned times are represented as an object containing "hours", "minutes", "seconds" and "millisecond" values
- AudioLibrary.GetAlbums(): Fields for have been stripped of the "album_" prefix
- AudioLibrary/VideoLibrary: Several new fields have been added and existing fields (e.g. "set", "showlink" and "cast") have been fixed
- "start" and "end" parameters for methods returning an array of items have been moved into a "limits" object. So now you have to use "params": { "limits": { "start": 5, "end": 15 }, ...}
These are only the most important changes that affect a lot of methods. If anyone has any particular problems with a certain method, parameter or value and can't make any sense of the received error message they are always welcome to post their questions in our forums (http://forum.xbmc.org/showthread.php?tid=68263).
The next steps concerning XBMC's JSON RPC API will be to update the our wiki with the latest information, write and publish JSON Schema descriptions for notifications sent by XBMC and extend notifications with additional data which belong to the notification (e.g. the current position where movie playback has been stopped).
Monday, April 18th 2011:
Commit: 42298b8e06ffd32eab32
- Renamed notifications using a naming schema similar to the method names i.e. Player.PlaybackResumed etc
- Renamed JSONRPC.Notify to JSONRPC.NotifyAll
- Added a new namespace Input containing the following methods to navigate in the XBMC GUI:
- Up
- Down
- Left
- Right
- Select
- Back
- Home
- Up
Saturday, April 23rd 2011:
Commit: 0c441d98cb24b7bd5473
- Added GetMovieSets and GetMovieSetDetails to VideoLibrary namespace
Wednesday, June 8th 2011:
Commits: f678c5df079ff3df7d87, cfd17225d55e52da049b, 427599e02e13a5ec36aa, 28743c1647d6cdef84fe
- Made tvshowid parameter for VideoLibrary.GetEpisodes optional
- Added GetArtistDetails to AudioLibrary namespace
- Added GetGenres to VideoLibrary namespace
- Refactoring and renaming of notifications
Saturday, June 18th 2011:
Commit: 482cb54953c7a450a4ff
- Added GetRecentlyAddedAlbums and GetRecentlyAddedSongs to AudioLibrary namespace
Wednesday, June 22th 2011:
Commits: 570da530375c22800743, d8e43a2a5399e7fe5ba9, fecb24254184c3b5eaae
- Added Export and Clean to AudioLibrary and VideoLibrary namespace
- Renamed ScanForContent to Scan in AudioLibrary and VideoLibrary namespace
Thursday, June 30th 2011:
Commits: 63cba75a76563554d10b
- Added Swap to AudioPlaylist and VideoPlaylist namespace
Friday, July 8th 2011:
Commits: 6bcd883be85f984308eb, 61bdb057b0149213a081
- Added Repeat and State to AudioPlaylist and VideoPlaylist namespace