How to to add a metadata subnode to jcr:content/metadata to files using AEM API from Fusion
For metadata organizational purposes, I am trying to add subnodes to jcr:content/metadata/ using the AEM Custom API Call module in Workfront Fusion. I am trying to do this after loading a new asset to AEM using Workfront Fusion.
For example, I'd like to add
- jcr:content/metadata/subnode1/subfield1
- jcr:content/metadata/subnode1/subfield2
- jcr:content/metadata/subnode2/subfield1
- jcr:content/metadata/subnode2/subfield2
I can add/update existing fields that live in /metadata just fine. It's when I am trying to add/update a subnode to /metadata where I have an issue since subnode1 and subnode2 do not yet exist (they are not automatically being added in AEM and hence do not appear through CRXDE Lite), i get a 403 error when trying to execute:
{
"class":"asset",
"properties":{
"metadata":{
"subnode1":{
"subfield1":"test",
"subfield2":"test"
}
}
}
}
Here is the complete input bundle:
[
{
"url": "api/assets/folder1/folder2/folder3/filename.pdf",
"body": "{\"class\":\"asset\",\"properties\":{\"metadata\":{\"subnode1\":{\"subfield1\":\"test\",\"subfield2\":\"test\"}}}}",
"method": "PUT",
"headers": [
{
"key": "Content-Type",
"value": "application/json"
}
]
}
]
Is there a way I can dynamically add subnode1 to jcr:content/metadata through the AEM API and Fusion?