Working JSON RPC API Examples - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93) +---- Forum: JSON-RPC (https://forum.kodi.tv/forumdisplay.php?fid=174) +---- Thread: Working JSON RPC API Examples (/showthread.php?tid=157996) |
RE: Working JSON RPC API Examples - MKANET - 2019-11-17 (2019-11-16, 08:00)IT007 Wrote: Thanks, looks a bit cleaner that what I came up with. I use logitech harmony and needed this for the power off command to stop kodi playback before exiting.No problem. I also use a Logitech Harmony for controlling Kodi, etc. RE: Working JSON RPC API Examples - iophobia - 2019-12-18 (2018-09-23, 19:48)iophobia Wrote: Don't know where to put this but hope somebody can help.Anybody managed to get Player.Open to work via IFTTT in Kodi 18? I don't wanna mess around with (my)OpenHAB implementations or such if it can be done in an easier way that already worked in v17. RE: Working JSON RPC API Examples - MKANET - 2019-12-18 (2019-12-18, 15:41)iophobia Wrote:(2018-09-23, 19:48)iophobia Wrote: Don't know where to put this but hope somebody can help.Anybody managed to get Player.Open to work via IFTTT in Kodi 18? I don't wanna mess around with (my)OpenHAB implementations or such if it can be done in an easier way that already worked in v17. I also have the same exact issue. It's one of the reasons why I haven't upgraded to Kodi 18. I use Cortana --> IFTTT --> EventGhost --> Kodi JSON-RPC on Kodi 17.6 (DSPlayer build). If you (or anyone) figures it out, PLEASE post here. I will also do the same. RE: Working JSON RPC API Examples - 2054you - 2019-12-29 how to shutdown kodi using request from external server? when was a normal version of kodi I used this url Quote:getURL('http://192.168.1.12:8080/jsonrpc?request={"jsonrpc":"2.0","method":"System.Shutdown","id":1}'); RE: Working JSON RPC API Examples - madkat - 2020-05-22 Can anyone give me a working example of subscribing to notifications? When I pass this:
I get this:
RE: Working JSON RPC API Examples - madkat - 2020-05-22 (2020-05-22, 05:20)madkat Wrote: Can anyone give me a working example of subscribing to notifications?Scratch that, I'm getting somewhere now:
RE: Working JSON RPC API Examples - madkat - 2020-05-22 (2020-05-22, 05:25)madkat Wrote:I'm not seeing any notifications though...? (Connected via TCP)(2020-05-22, 05:20)madkat Wrote: Can anyone give me a working example of subscribing to notifications?Scratch that, I'm getting somewhere now: RE: Working JSON RPC API Examples - madkat - 2020-05-22 (2020-05-22, 14:24)madkat Wrote:(2020-05-22, 05:25)madkat Wrote:I'm not seeing any notifications though...? (Connected via TCP)(2020-05-22, 05:20)madkat Wrote: Can anyone give me a working example of subscribing to notifications?Scratch that, I'm getting somewhere now: I am seeing notifications - e.g. play/pause. New problem with Live TV: I pass this method invocation:
And I get back a perfectly sensible reply:
However, the "time" is the time of the stream, not the time of the playing programme - if I pause, the "time" returned continues to increase. Do I need to do something with the PVR to get the state information I'm looking for? RE: Working JSON RPC API Examples - karlzre - 2020-07-24 Hi, I would like to launch a addon from a remote server. i found this but didn't work, can you show me a example how to launch a addon ?
RE: Working JSON RPC API Examples - HTGeek - 2020-07-25 (2020-07-24, 19:45)karlzre Wrote: Hi, Your message doesn't display properly. Are you on a Mac? I'm asking due to all the "%22" references in your URL. They should be spaces. You must send a RESTful command to your Kodi's HTTP server address. IIRC, Kodi 16 and earlier requires a GET command. Kodi 17+ uses POST. Instructions using command line/CURL/BaSH formatting found here. RE: Working JSON RPC API Examples - mpg732 - 2020-08-02 Can any one tell me if its possible to combine these into one command, {"jsonrpc": "2.0", "method": "Player.GetProperties", "params": { "properties": ["currentaudiostream", "percentage", "totaltime", "speed"], "playerid": 1 }, "id": "VideoGetItem"} and {"jsonrpc": "2.0", "method": "Player.GetItem", "params": { "properties": ["title", "thumbnail"], "playerid": 1 }, "id": "1"} thanks RE: Working JSON RPC API Examples - a1rwulf - 2020-08-03 (2020-08-02, 06:33)mpg732 Wrote: Can any one tell me if its possible to combine these into one command,Sry, that's not possible. RE: Working JSON RPC API Examples - hernandito - 2020-08-08 Sorry for cross-posting....Mods, please feel free to delete my original post. This thread seems more relevant than the one where I posted originally. Onward.... I run my own self hosted web page where I admin many of my home server items. While not an expert, for years I muddled through figuring out how to do things. I created this page in php. One of the many things I was able to do, were Video and Music Library Updates. Leia simply killed this feature (and others). I did not realize this until I upgraded from Krypton. Without luck, I have tried for many many hours, to execute the curl command that performs this action in PHP: curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "mybash"}' -H 'content-type: application/json;' http://kodi:[email protected]:80/jsonrpc Would some kind soul please guide me to make php execute the above curl command... every sample I have seen includes "options, arrays, things" that I cannot relate to the line above. Figuring this out will allow me to also update a few other bits that my page did. I have grown accustomed executing many Kodi commands with the old API method. I have Kodi on a couple of Intel NUC's running LibreElec. Thank you in advance. H. RE: Working JSON RPC API Examples - hernandito - 2020-08-09 Answering my own question above.... I would have NEVER figured this out until I ran into a web site that does Curl to PHO conversion. https://incarnate.github.io/curl-to-php/ I entered: curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "mybash"}' -H 'content-type: application/json;' http://kodi:[email protected]:80/jsonrpc and it output this:
It works like a charm... I was able to tweak things to adapt to my needs. I hope this helps someone. I found that site purely by luck. Thanks, H. RE: Working JSON RPC API Examples - Klojum - 2020-09-22 (2020-08-09, 02:12)hernandito Wrote: and it output this: Did you know that this forum has color-syntax support? |