Didn't know we could access favourites via JSON. Just used it to retrieve the user favourites - so much nicer than parsing the favourites.xml file manually.
I used JSONRPC.Introspect() to get the details of how to use it. The relevant bits are below.
Code:
"Favourites.AddFavourite": {
"description": "Add a favourite with the given details",
"params": [
{
"name": "title",
"required": true,
"type": "string"
},
{
"$ref": "Favourite.Type",
"name": "type",
"required": true
},
{
"$ref": "Optional.String",
"default": null,
"description": "Required for media and script favourites types",
"name": "path"
},
{
"$ref": "Optional.String",
"default": null,
"description": "Required for window favourite type",
"name": "window"
},
{
"$ref": "Optional.String",
"default": null,
"name": "windowparameter"
},
{
"$ref": "Optional.String",
"default": null,
"name": "thumbnail"
}
],
"returns": {
"type": "string"
},
"type": "method"
},
"Favourites.GetFavourites": {
"description": "Retrieve all favourites",
"params": [
{
"default": null,
"name": "type",
"type": [
{
"type": "null"
},
{
"$ref": "Favourite.Type"
}
]
},
{
"$ref": "Favourite.Fields.Favourite",
"name": "properties"
}
],
"returns": {
"properties": {
"favourites": {
"items": {
"$ref": "Favourite.Details.Favourite"
},
"type": "array"
},
"limits": {
"$ref": "List.LimitsReturned",
"required": true
}
},
"type": "object"
},
"type": "method"
},
"Favourite.Details.Favourite": {
"additionalProperties": false,
"id": "Favourite.Details.Favourite",
"properties": {
"path": {
"default": "",
"type": "string"
},
"thumbnail": {
"default": "",
"type": "string"
},
"title": {
"required": true,
"type": "string"
},
"type": {
"$ref": "Favourite.Type",
"required": true
},
"window": {
"default": "",
"type": "string"
},
"windowparameter": {
"default": "",
"type": "string"
}
},
"type": "object"
},
"Favourite.Fields.Favourite": {
"extends": "Item.Fields.Base",
"id": "Favourite.Fields.Favourite",
"items": {
"enums": [
"window",
"windowparameter",
"thumbnail",
"path"
],
"type": "string"
}
},
"Favourite.Type": {
"default": "media",
"enums": [
"media",
"window",
"script",
"unknown"
],
"id": "Favourite.Type",
"type": "string"
}
Hope that's useful to you.