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
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
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.
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.
(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.
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
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.
(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 Confused

PS: Sorry :/
Did you actually MD5 encode your password or did you just add "encryption": "md5"?
Oh need encode with tool like this : http://7thspace.com/webmaster_tools/onli...coder.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 ?
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?
{"jsonrpc":"2.0","method":"Profiles.LoadProfile","params":{"profile":"Master%20user","password":{"value":"827ccb0eea8a706c4c34a16891f84e7b","encryption":"md5"}},"id":1}

same issue ://
Please start a new thread..... This has nothing to do with examples anymore
(can a mod split this into a new one? )
sorry :/


thread for Profiles.Loadprofile:

http://forum.xbmc.org/showthread.php?tid=176988
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
Example for turning off system?
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15