Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

HTTP API Asset get metadata

Avatar

Avatar
Validate 1
Level 1
marcinn
Level 1

Likes

2 likes

Total Posts

9 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
marcinn
Level 1

Likes

2 likes

Total Posts

9 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
marcinn
Level 1

13-04-2021

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. 

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar
Affirm 100
Level 10
asutosh_jena
Level 10

Likes

367 likes

Total Posts

462 posts

Correct Reply

134 solutions
Top badges earned
Affirm 100
Ignite 1
Establish
Give Back 50
Give Back 5
View profile

Avatar
Affirm 100
Level 10
asutosh_jena
Level 10

Likes

367 likes

Total Posts

462 posts

Correct Reply

134 solutions
Top badges earned
Affirm 100
Ignite 1
Establish
Give Back 50
Give Back 5
View profile
asutosh_jena
Level 10

13-04-2021

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.

 

asutosh_j3_0-1618320011705.png

asutosh_j3_1-1618320039726.png

http://localhost:4502/api/assets/wknd-events/wknd-events.jpg.json

 

Thanks!

marcinn

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. 

 

marcinn_0-1618320363356.png

 

but my asset in CRX looks like this

 

marcinn_1-1618320394184.png

I've also Dynamic Media configured there, and frankly speaking, I need few scene7 fields. 

asutosh_jena

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!

marcinn

Hi

 

thx for your comment. I did some tests, and you're right additional metadata filed (which I've added) works

marcinn_0-1618378820932.png

 

but unfortunately, I need those values in dam namespace. (especially dam:scene7Domain, dam:scene7Type, 

dam:sceneFile). Any chance to get them from API or from any other way but in JS file?
asutosh_jena

Hi @marcinn 

 

Unfortunately there is no such config to allow it.

But you can try the sync metadata approach like below:

  1. You can create a workflow and configure Experience Manager to execute the workflow when the dynamic media workflow completes.
  2. Use an ECMA script to sync the required metadata properties from dam:* to some custom Property.
  3. Read the custom property in the JSON response and use it wherever required.
  4. The following sample script synchronizes the title string between dc:title and jcr:title.
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:

https://experienceleague.adobe.com/docs/experience-manager-65/assets/extending/mac-api-assets.html?l...

 

Hope this helps!

Thanks 🙂