


Hi
Can the user somehow configure, which metadata fields will be returned via asset API?
I need some additional fields, but unfortunately, I can't see them in returned JSON.
Thank you in advance for any tips.
Solved! Go to Solution.
Views
Replies
Sign in to like this content
Total Likes
Hi @marcinn
Have you added the additional matadata to assets? If it's added to the assets, it will be fetched by assets API.
Such as if you have an additional field as "something" which is having a value of "Somevalue" in the metadata node of the asset, when you try to fetch the metadata for the perticular asset, it will fetch the additional metadata and will show in the JSON response.
http://localhost:4502/api/assets/wknd-events/wknd-events.jpg.json
Thanks!
Hi @marcinn
Have you added the additional matadata to assets? If it's added to the assets, it will be fetched by assets API.
Such as if you have an additional field as "something" which is having a value of "Somevalue" in the metadata node of the asset, when you try to fetch the metadata for the perticular asset, it will fetch the additional metadata and will show in the JSON response.
http://localhost:4502/api/assets/wknd-events/wknd-events.jpg.json
Thanks!
Hi
many thanks for your answer, unfortunately, it doesn't look like in my case. I've added many fields to metadata, but I'm getting only few.
but my asset in CRX looks like this
I've also Dynamic Media configured there, and frankly speaking, I need few scene7 fields.
Views
Replies
Sign in to like this content
Total Likes
Hi @marcinn
I see you have all the property starting with dam:* any property starting with dam:* are not getting pulled into the JSON response whereas any custom property will be pulled into the response. Can you try it and see if it works for you or not by adding any custom property?
Thanks!
Views
Replies
Sign in to like this content
Total Likes
Hi
thx for your comment. I did some tests, and you're right additional metadata filed (which I've added) works
but unfortunately, I need those values in dam namespace. (especially dam:scene7Domain, dam:scene7Type,
Views
Replies
Sign in to like this content
Total Likes
Hi @marcinn
Unfortunately there is no such config to allow it.
But you can try the sync metadata approach like below:
var workflowData = workItem.getWorkflowData();
if (workflowData.getPayloadType() == "JCR_PATH")
{
var path = workflowData.getPayload().toString();
var node = workflowSession.getSession().getItem(path);
var metadataNode = node.getNode("jcr:content/metadata");
var jcrcontentNode = node.getNode("jcr:content");
if (jcrcontentNode.hasProperty("jcr:title"))
{
var jcrTitle = jcrcontentNode.getProperty("jcr:title");
metadataNode.setProperty("dc:title", jcrTitle.toString());
metadataNode.save();
}
}
You can try the same steps for your custom property.
Here is the detailed article:
Hope this helps!
Thanks 🙂
Views
Replies
Sign in to like this content
Total Likes