got a quick question about the JSON XBMC API. I want to use the GetInfoLabels command to get a lot of information about the system on my webpage. But I can't figure out how this command works. I tried the following
http://192.168.5.34/jsonrpc?request={"jsonrpc":"2.0","id":"1","method":"XBMC.GetInfoLabels","params":["Network.IPAddress","Network.MacAddress"]}
But then I get this output
{"error":{"code":-32602,"data":{"method":"XBMC.GetInfoLabels","stack":{"message":"Invalid type string received","name":"labels","type":"array"}},"message":"Invalid params."},"id":"1","jsonrpc":"2.0"}
So the error is "Invalid type string received" but I can't get it to work. I tried only 1 label, without the quotes, between extra {}, ... Most of them give a "Parse errro" so I think this is the best I could get it. ANy one got an idea how to use this command?
Thanks
Ok, after a lot of research it seems I had to make an object of an array of labels. So this is the working solution
http://192.168.5.34/jsonrpc?request={"jsonrpc":"2.0","method":"XBMC.GetInfoLabels","params":{"labels": ["Network.IPAddress","Network.MacAddress"] },"id":1}
As a result you get the IP and MAC from the XBMC system.