Sending on-screen notifications using the JSON API
#16
[Removed--Duplicate]
Reply
#17
I'm having an issue when running
Code:
$msg="message"
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"id":1,"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"0Dough","message":"$msg"}}' http://xbmc:8080/jsonrpc

The alert is sent, but the content is "$msg" instead of "message".

Any help would be greatly appreciated.
Reply
#18
You have your POST payload within single quotes, I'm assuming you're running this from a shell script or on the command line? Single quotes don't expand out variables, it just puts the string in as a literal. Not quite as readable but you need to get rid of the single quotes where the variable is, something like:

Code:
'{"message":"'$message'"}'
Reply

Logout Mark Read Team Forum Stats Members Help
Sending on-screen notifications using the JSON API0