Extend JSON-RPC API through Add On
#1
I have recently purchased an Amazon Echo and have been doing a bit of development for this platform. I am investigating how I could farther integrate Amazon Echo with existing third party add ons for Kodi. As I am a bit new to add on development for Kodi, I was wondering if it is possible to extend the JSON-RPC API through a third party add on? That is, I would like to define additional JSON-RPC commands that could be sent from an outside web service that would then be handled/honored by the add on.

For example,

Say I wanted to play Youtube videos from Kodi from Amazon Echo (external web service) using a Kodi Youtube add on.

Ideally, I would like to be able to expand the existing Youtube add on to support additional JSON-RPC commands that would drive behavior of this add on. Then, I could define my own commands and handle them through the add on, and drive the add ons behavior through an external web service (integrated into Amazon Echo)

If anyone knows if this is possible currently and/or has any resources to point me too, I would be very grateful.

Thanks!

UPDATE: After looking over http://kodi.wiki/view/JSON-RPC_API/v6 again, it appears what I may be able to accomplish what I am after by using Addons.ExecuteAddon and passing in the commands to the add on via parameters for the plugin. Is this the correct approach? If anyone could point me to an example, that would help a great deal!
Reply
#2
(2016-07-10, 21:06)cfsb78 Wrote: UPDATE: After looking over http://kodi.wiki/view/JSON-RPC_API/v6 again, it appears what I may be able to accomplish what I am after by using Addons.ExecuteAddon and passing in the commands to the add on via parameters for the plugin. Is this the correct approach? If anyone could point me to an example, that would help a great deal!

If I'm not mistaken, Files.GetDirectory method can accept virtual folder paths, like plugin://plugin.video.foo/ or plugin://plugin.video.bar/?param1=value1&param2=value2, too. This approach is more suitable for content plugins, like Youtube.

Regarding your question in general, you cannot change the existing Kodi JSON-RPC API withiut re-writing Kodi core code, but you can implement your own JSON-RPC API in your addon that can extend the existing Kodi JSON-RPC. Python is widely used for writing web services and has plenty of libraries for that purpose.
Reply

Logout Mark Read Team Forum Stats Members Help
Extend JSON-RPC API through Add On0