I'm trying to use the JavaScript API to set the metadata of product assets (because it seems it can't be done with a trigger). However, I am very much a novice with JavaScript and I can't even get a simple test to work.
I wonder if someone can tell me why the following code fails to update the metadata for the page #24785 and product #20092 assets, even though the setMetaData function does actually get all the way through to running its dataCallback function:
[quote]
I'm trying to use the JavaScript API to set the metadata of product assets (because it seems it can't be done with a trigger). However, I am very much a novice with JavaScript and I can't even get a simple test to work.
I wonder if someone can tell me why the following code fails to update the metadata for the page #24785 and product #20092 assets, even though the setMetaData function does actually get all the way through to running its dataCallback function:
I have actually correctly closed the first script tag (the code I pasted in my original post was wrong). I have updated my code to include a proper callback function. I have the API asset set up for all commands and have not specified a root node (which I understand means I can apply the API anywhere).
According to the Firebug console:
[quote]{"error":"You do not have permissions to access this asset"}[/quote]
I don't really understand what this means as I certainly do have permission to access the asset (I am a system administrator) and have turned on "Ignore Permissions".
I have actually correctly closed the first script tag (the code I pasted in my original post was wrong). I have updated my code to include a proper callback function. I have the API asset set up for all commands and have not specified a root node (which I understand means I can apply the API anywhere).
According to the Firebug console:
I don't really understand what this means as I certainly do have permission to access the asset (I am a system administrator) and have turned on "Ignore Permissions".
[/quote]
Check your Root Node settings. Does the asset you're trying to modify live under the designated Root Node?