JSON-RPC fails to parse
#1
I'm freaking out because of this tiny little problem:
Whatever I do, XBMC fails to parse my JSON-RPC requests Angry

This is my code:
Code:
query = {
            'jsonrpc': '5.0',
            'method': 'Player.GetItem',
            'params': {
                'playerid': 0,
                'properties': ['imdbnumber']
            }
        }
json_string = xbmc.executeJSONRPC(json.dumps(query))

...and this is what I get:
Code:
ERROR: JSONRPC: Failed to parse '{"jsonrpc":"5.0","method":"Player.GetItem","params":{"playerid":0,"properties":["imdbnumber"]}}'

What am I doing wrong?

PS. I'm running XBMC 13.0
Reply
#2
jsonrpc:2.0 , not 5.0
Reply
#3
Oh. Thought it was the JSON-RPC API version!
Reply
#4
Does that fix it?

Because I thought the API needed an ID number in order to send back the results.
Reply
#5
Nope that did not fix it, and you are correct. I discovered later on (using JSON Browser found here on the forum) that an ID is needed. I do not know where in the docs it says that, at least I couldn't find it. So yeah, now it works!
Reply

Logout Mark Read Team Forum Stats Members Help
JSON-RPC fails to parse0