Kodi Community Forum

Full Version: Working JSON RPC API Examples
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
I'm missing a JSON-RPC call for setting a switch timer (or notification timer aka reminder) in the JSON RPC API v12 (Matrix). The implementation of such a timer is already done by ksooo. Is it possible to set/unset such a timer via json anyway?
(2020-10-15, 09:51)_BJ1 Wrote: [ -> ]I'm missing a JSON-RPC call for setting a switch timer (or notification timer aka reminder) in the JSON RPC API v12 (Matrix). The implementation of such a timer is already done by ksooo. Is it possible to set/unset such a timer via json anyway?
The v12 JSON spec for Kodi is found here: https://kodi.wiki/view/JSON-RPC_API/v12

What exactly are you attempting to accomplish? The PVR Timers might be helpful, but it depends on your needs. I have not fiddled with them, personally.
I know the v12 spec from kodi.wiki. I am missing the possibility to control a reminder timer. This is a new timer introduced with Kodi Matrix. This timer only switch to a desired channel at a given time instead of recording them. I need this for an addon.
I cannot figure out how to send a JSONRPC command to page down

input.pagedown   Specifically to Yatse.  I don't understand JSONRPC.  what is the method?? and what would the parameters be?
I read another thread and someone suggested the following

http://192.168.1.70:8082/jsonrpc?request={ "jsonrpc": "2.0", "method": "Input.ExecuteAction", "params": { "action": "pagedown" }, "id": 1 }

obviously replacing ip with mine

i tried that in yatse custom commands.  what goes in method field?  Input.executeaction?
then in params field i tried the above but it says must be encased in {}  i tried encasing the entire thing in {} but still get the error
(2020-10-31, 16:21)[email protected] Wrote: [ -> ]I read another thread and someone suggested the following

http://192.168.1.70:8082/jsonrpc?request={ "jsonrpc": "2.0", "method": "Input.ExecuteAction", "params": { "action": "pagedown" }, "id": 1 }

obviously replacing ip with mine

i tried that in yatse custom commands.  what goes in method field?  Input.executeaction?
then in params field i tried the above but it says must be encased in {}  i tried encasing the entire thing in {} but still get the error

Anyone?
I have a question.
When I get movies the imdbnumbers are always presents or this variable can be empty?
For example if I use a different scraper from TMDB or IMDB. Imdbnumbers will be empty?
(2021-01-27, 00:24)TillMoss Wrote: [ -> ]For example if I use a different scraper from TMDB or IMDB. Imdbnumbers will be empty?
If you are using a current version of Kodi and the scrapers, then the scrapers should always download the IMDB ID. If you are using TheMovieDB, then it requires that someone has added the IMDB ID in the edit screen of the movie/tv show/episode.
(2015-11-11, 04:14)xgutterratx Wrote: [ -> ]
(2015-11-03, 23:59)atailo Wrote: [ -> ]I am trying to create a keyboard for irule program json commands to the kodi, but nocmando send text when I send the first texte he does not allow write the second, for instance created text with the letter "a" and the letter "b "but if I hit any of the two he did not add another, only replacing the letter by the other. is there any way to solve?


{"jsonrpc":"2.0","method":"Input.SendText","params": {"text": "A", "done":false},"id":1}
{"jsonrpc":"2.0","method":"Input.SendText","params": {"text": "B", "done":false},"id":1}

I got this to work with irule email me at [email protected]
Apologies for jumping in to an old thread (and for cross-posting), but my iRule config broke after upgrading to Leia as well - and I don't speak JSON beyond what I've learned via copy / paste (I paid a guy to do my iRule config).  Is there basic approach for updating the JSON commands from within iRule Builder, or a global setting / command to get them working?

Any assistance would be apprecitated!
Hello 

I want to add some code examples and ask a question:

Code:
http://yourkodiipishere:8080/jsonrpc?request={"jsonrpc": "2.0", "method": "PVR.GetChannels", "params": {"channelid": "alltv"},"id": 1}]
<<< it is useful if you get info by your browser. All of PVR channel and groups will be displayed.

Code:
/usr/bin/curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"id":1,"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"channelid":912}}}' http://yourkodiipishere:8080/jsonrpc]
<<< this code will be open your channel (the channel no that you will see on kodi GUI) use a console like putty.

Code:
curl -s --data-binary '{"jsonrpc": "2.0", "method": "PVR.GetChannels", "params": {"channelgroupid" : "alltv"}, "id": 1 }' -H 'content-type: application/json;' http://yourkodiipishere:8080/jsonrpc]
<<< use with console. This will give you all channel numbers that you can use previous code.

Here is the question:

Why the 1.st code and 3.rd code is resulting different codes? how can I see 3rd code results in web browser?

(BTW: I am sorry for the second post. I couldn't edit my previous wrong one. That is why I post this entry one more time.)
@konrul FYI, your edit powers will be available soon. It's all part of a set of anti-spam measures that are active on this forum.
(2021-11-11, 22:22)konrul Wrote: [ -> ]Hello 

I want to add some code examples and ask a question:

Code:
http://yourkodiipishere:8080/jsonrpc?request={"jsonrpc": "2.0", "method": "PVR.GetChannels", "params": {"channelid": "alltv"},"id": 1}]
<<< it is useful if you get info by your browser. All of PVR channel and groups will be displayed.

Code:
/usr/bin/curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"id":1,"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"channelid":912}}}' http://yourkodiipishere:8080/jsonrpc]
<<< this code will be open your channel (the channel no that you will see on kodi GUI) use a console like putty.

Code:
curl -s --data-binary '{"jsonrpc": "2.0", "method": "PVR.GetChannels", "params": {"channelgroupid" : "alltv"}, "id": 1 }' -H 'content-type: application/json;' http://yourkodiipishere:8080/jsonrpc]
<<< use with console. This will give you all channel numbers that you can use previous code.

Here is the question:

Why the 1.st code and 3.rd code is resulting different codes? how can I see 3rd code results in web browser?

(BTW: I am sorry for the second post. I couldn't edit my previous wrong one. That is why I post this entry one more time.)

I don't quite understand your question, unless you're confused about why the syntax of the 1st and 3rd code lines are different.

The first example is sending a command to a server via port 8080. It's simply delivering that command via a web browser to (presumably) an API. The third example sends a slightly different command to the same server address, same port number, same API end point, but via CURL. The third line is something you'd type in a Command Line Interface (CLI), such as a SHell program on a server.

They are simply two different methods of delivering a message, depending on the delivery method of the sender. The process on the receiving end (receiving server) is going to be the same. It will receive a command from the API end point and process it. In these examples, the command 1 instruction is different from that in command line 3 (channel ID vs group channel ID).
Is there a JSONRPC that I can use to delete the currently playing song? Or, supply a filename and delete that file from my database? I want to use webcore and the Kodi API to do this with an Alexa command, such as "Alexa, delete this song."
(2021-11-12, 01:01)HTGeek Wrote: [ -> ]
(2021-11-11, 22:22)konrul Wrote: [ -> ]Hello 

I want to add some code examples and ask a question:

Code:
http://yourkodiipishere:8080/jsonrpc?request={"jsonrpc": "2.0", "method": "PVR.GetChannels", "params": {"channelid": "alltv"},"id": 1}]
<<< it is useful if you get info by your browser. All of PVR channel and groups will be displayed.

Code:
/usr/bin/curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"id":1,"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"channelid":912}}}' http://yourkodiipishere:8080/jsonrpc]
<<< this code will be open your channel (the channel no that you will see on kodi GUI) use a console like putty.

Code:
curl -s --data-binary '{"jsonrpc": "2.0", "method": "PVR.GetChannels", "params": {"channelgroupid" : "alltv"}, "id": 1 }' -H 'content-type: application/json;' http://yourkodiipishere:8080/jsonrpc]
<<< use with console. This will give you all channel numbers that you can use previous code.

Here is the question:

Why the 1.st code and 3.rd code is resulting different codes? how can I see 3rd code results in web browser?

(BTW: I am sorry for the second post. I couldn't edit my previous wrong one. That is why I post this entry one more time.)

I don't quite understand your question, unless you're confused about why the syntax of the 1st and 3rd code lines are different.

The first example is sending a command to a server via port 8080. It's simply delivering that command via a web browser to (presumably) an API. The third example sends a slightly different command to the same server address, same port number, same API end point, but via CURL. The third line is something you'd type in a Command Line Interface (CLI), such as a SHell program on a server.

They are simply two different methods of delivering a message, depending on the delivery method of the sender. The process on the receiving end (receiving server) is going to be the same. It will receive a command from the API end point and process it. In these examples, the command 1 instruction is different from that in command line 3 (channel ID vs group channel ID).
Thank you for your quick reply.

I understand what you mean, but it is hard to explain I think. in the first code, I am able to see all of results on my browser so that I can find specific channel id quickly. But the 3rd one, which is sent by CLI command, results in a small CLI window and I can't see every details like in the first code. And also, the results are different even if the codes are the same. Let me show an example:

This is the answer from CLI query:

{"channelid":3187,"label":"Büyük Değişim 2.Bölüm EXXEN"}

This is the answer from first code with 8080 port:
{"channelid":3187,"label":"Büyük Değişim 2.Bölüm EXXEN","uniqueid":369625866}

as you can see here,  I cant get "uniqueid" from cli results...

On the other hand, I will be thankful if you can advise any way to see all of the results from CLI.

Thank you!
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15