•   
  • 1
  • 7
  • 8
  • 9
  • 10
  • 11(current)
Working JSON RPC API Examples
(2018-10-22, 21:39)black_eagle Wrote:  Get is supported in V18 according to the protocol table here
As for many things Wiki is out of date. For security reasons there is a significant change in v18 that prevents GET working for most of the API commands. Use POST instead.
Reply
(2018-10-23, 13:23)DaveBlake Wrote:
(2018-10-22, 21:39)black_eagle Wrote:  Get is supported in V18 according to the protocol table here
As for many things Wiki is out of date. For security reasons there is a significant change in v18 that prevents GET working for most of the API commands. Use POST instead.  
Ah, cheers Dave, I wasn't aware of that.  The only jsonprc requests I make outside of an addon are done with curl --data-binary in bash scripts and using --data automatically makes curl use POST.  eg, to set the volume

curl -s --data-binary '{ "jsonrpc": "2.0", "method": "Application.SetVolume","params": {"volume":'50'}, "id": 1}' -H 'content-type: application/json;' http://localhost:8080/jsonrpc
Learning Linux the hard way !!
Reply
So I am trying to write webcore code to play a particular playlist (Vocal Trance). Of course, webcore has a Play Track command but not a Play Playlist command. After lots of reading I am thinking I will have to use JSON-RPC to get Kodi to play a playlist. Thoughts on how I would do that?
Reply
Example of using JSON to play a m3u playlist
Code:
[{"jsonrpc": "2.0", "id": 0, "method": "Playlist.Clear", "params": {"playlistid": 0}},
{"jsonrpc":"2.0","id":0,"method":"Player.Open","params":{"item":{"recursive":true, "directory":"C:/MyMusic/TestList.m3u"}}}]

Also seee https://forum.kodi.tv/showthread.php?tid...pid2606438
Reply
Any working solution to play a PVR channel ?
This worked before updating to kodi 18 but not anymore

{"id":1,"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"channelid":167}}}

send error: Error: Server responded with error: Invalid params
Reply
(2015-07-27, 06:05)lammyoflyd Wrote: http://192.168.1.107/jsonrpc?request={"jsonrpc":"2.0","id":"1","method":"Player.Open","params":{"item":{"file":"special://profile/playlists/music/Morning.xsp"}}}

Thank you SO MUCH. I have been looking all over for this.
Reply
Hi,

Many good examples in this thread, a wiki by its own for many !

In case some are interested, I wrote a php script handling json/rpc for many commands, to integrate Kodi into my smarthome.
Here is the github:

https://github.com/KiboOst/php-Kodi-jsonAPI

I may make a python equivalent someday, as I may need it also.

Wink
Reply
For those of you interested in using webCoRE and JSON RPC to access the Kodi API and pass a playlist for Kodi to play.........check here.
Reply
  •   
  • 1
  • 7
  • 8
  • 9
  • 10
  • 11(current)
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
Working JSON RPC API Examples00