Working JSON RPC API Examples

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
roscoe Offline
Junior Member
Posts: 5
Joined: Apr 2012
Reputation: 0
Post: #16
hi I put up some python code which will:
- read in an external playlist
- put it to music queue
- play it

it can be extended easily

http://forum.xbmc.org/showthread.php?tid...pid1454037

it do post the link in this thread because I think it can better be found under the above topic
Working JSON RPC API Examples
Smile
find quote
armyofme Offline
Junior Member
Posts: 23
Joined: Jun 2012
Reputation: 0
Post: #17
Thanks Pghpunkid for your examples....the examples on the wiki are not as straightforward for the less technically minded!

Only problem is...when I tried them thorugh the web browser I get this message returned regardless to the example I use:

"JSONRPC active and working"

Any idea why it's returning this instead of what's been requesting? I've selected all the options in XBMC network-settings.
find quote
Montellese Offline
Team Kodi Developer
Posts: 4,836
Joined: Jan 2009
Reputation: 72
Location: Switzerland
Post: #18
You're version of XBMC is probably too old and doesn't support JSON-RPC requests using HTTP GET (only POST). Otherwise it should return the whole JSON schema API description if you just do a HTTP GET request to http://<ip>:<port>/jsonrpc.

Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
find quote
armyofme Offline
Junior Member
Posts: 23
Joined: Jun 2012
Reputation: 0
Post: #19
(2013-09-15 15:04)Montellese Wrote:  You're version of XBMC is probably too old and doesn't support JSON-RPC requests using HTTP GET (only POST). Otherwise it should return the whole JSON schema API description if you just do a HTTP GET request to http://<ip>:<port>/jsonrpc.

Thank you...you're absolutely correct. I've tried it on my Raspberry Pi which has the Frodo on and it works.
find quote
yallah Offline
Senior Member
Posts: 231
Joined: May 2011
Reputation: 2
Location: Cannes, France
Post: #20
hi, try to use with gotham alpha8 :

http://192.168.2.176/jsonrpc?request={"jsonrpc":"2.0","method":"Profiles.LoadProfile","params":{"profile":"Master user","password":{"value":"12345"}},"id":1}

and return me:

error: {
code: -32602,
message: "Invalid params."
},
id: 1,
jsonrpc: "2.0"

did I mistake something in syntax

thanks by advance
(This post was last modified: 2013-10-31 14:52 by yallah.)
find quote
Montellese Offline
Team Kodi Developer
Posts: 4,836
Joined: Jan 2009
Reputation: 72
Location: Switzerland
Post: #21
There are several things that could have gone wrong:
  • Is the name of the profile right?
  • Did you MD5 encodeyour password? If not you either need to do that or set the optional "encryption" property of the "password" parameter to "none". For security reasons the default is to MD5-encode your password.

PS: This is not the right thread to ask about problems with requests.

Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
(This post was last modified: 2013-10-31 16:19 by Montellese.)
find quote
yallah Offline
Senior Member
Posts: 231
Joined: May 2011
Reputation: 2
Location: Cannes, France
Post: #22
(2013-10-31 16:18)Montellese Wrote:  There are several things that could have gone wrong:
  • Is the name of the profile right?
  • Did you MD5 encodeyour password? If not you either need to do that or set the optional "encryption" property of the "password" parameter to "none". For security reasons the default is to MD5-encode your password.

PS: This is not the right thread to ask about problems with requests.

1/ Yes : I user right profile name because when I use http://192.168.2.176/jsonrpc?request={"jsonrpc":"2.0","method":"Profiles.LoadProfile","params":{"profile":"Master user"},"id":1} , it's working (when I remove password in profile from xbmc client).

2/ I tried already with http://192.168.2.176/jsonrpc?request={"jsonrpc":"2.0","method":"Profiles.LoadProfile","params":{"profile":"Master user","password":{"value":"12345","encryption":"none"}},"id":1} or http://192.168.2.176/jsonrpc?request={"jsonrpc":"2.0","method":"Profiles.LoadProfile","params":{"profile":"Master user","password":{"value":"12345","encryption":"md5"}},"id":1} , it's same issue Frown

PS: Sorry :/
(This post was last modified: 2013-10-31 17:43 by yallah.)
find quote
Montellese Offline
Team Kodi Developer
Posts: 4,836
Joined: Jan 2009
Reputation: 72
Location: Switzerland
Post: #23
Did you actually MD5 encode your password or did you just add "encryption": "md5"?

Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
find quote
yallah Offline
Senior Member
Posts: 231
Joined: May 2011
Reputation: 2
Location: Cannes, France
Post: #24
Oh need encode with tool like this : http://7thspace.com/webmaster_tools/onli...oder.html.

but why If I put http://192.168.2.176/jsonrpc?request={"jsonrpc":"2.0","method":"Profiles.LoadProfile","params":{"profile":"Master user","password":{"value":"12345","encryption":"none"}},"id":1} it doesn't work also ?
find quote
Montellese Offline
Team Kodi Developer
Posts: 4,836
Joined: Jan 2009
Reputation: 72
Location: Switzerland
Post: #25
It should but TBH I didn't write the code and I've never used XBMC profiles in my life so I'd have to take some time to look into it. Did it work with the encoded password?

Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
find quote
yallah Offline
Senior Member
Posts: 231
Joined: May 2011
Reputation: 2
Location: Cannes, France
Post: #26
{"jsonrpc":"2.0","method":"Profiles.LoadProfile","params":{"profile":"Master%20user","password":{"value":"827ccb0eea8a706c4c34a16891f84e7b","encryption":"md5"}},"id":1}

same issue ://
find quote
Martijn Offline
Team Kodi
Posts: 16,928
Joined: Jul 2011
Reputation: 310
Location: Dawn of time
Post: #27
Please start a new thread..... This has nothing to do with examples anymore
(can a mod split this into a new one? )

Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
find quote
yallah Offline
Senior Member
Posts: 231
Joined: May 2011
Reputation: 2
Location: Cannes, France
Post: #28
sorry :/


thread for Profiles.Loadprofile:

http://forum.xbmc.org/showthread.php?tid=176988
find quote
xbmconatv2 Offline
Junior Member
Posts: 19
Joined: Sep 2011
Reputation: 0
Post: #29
Can someone post an example for accessing entries in the Bookmarks table of the Database? I have a script that uses the old/deprecated executehttpapi method that obviously does not work anymore. I've been trying to find a way to read entries from Bookmarks using jsonrpc but I have not found anything yet. Here's a link to something that I did with the Bookmarks.
Thanks
find quote
tonilundin Offline
Junior Member
Posts: 1
Joined: Jun 2014
Reputation: 0
Post: #30
Example for turning off system?
find quote
Post Reply