Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Headless content fragment - Assets http API with content reference

Avatar

Level 2

Headless architecture - I am able to see the content reference content fragment elements via graphql but while using HTTP asset API services, its giving only reference path information.

 

Could you anyone let me know is there any OOTB API is available to get content reference in asset api or we need to write a custom logic to iterate those content reference.

 

CF:

sathyaprakash_0-1670319433715.png

Graphql Response:

 

sathyaprakash_1-1670319570826.png

 

Assest API : Rest Call

 

sathyaprakash_2-1670319656513.png

 

 

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi @sathyaprakash,

 

It's not available Out of the box in Assets API, As stated in the API Docs here "References are delivered as reference URLs". 

 

Please check the Assets API documentation for content fragments.

https://developer.adobe.com/experience-manager/reference-materials/cloud-service/javadoc/assets-api-... 

 

Regards,

Nitesh

View solution in original post

4 Replies

Avatar

Employee Advisor

@sathyaprakash 

You can get more attributes out of Content Reference, but currently these are limited, like path, author, size etc. 
Please see such sample queries below:

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/headless/graphql-ap...

 

Avatar

Level 2

@krati_garg Thanks for your reply! My query here is how to get content reference elements in assets http api - localhost:4502/api/assets/my-project/en/team-alpha.json

 

sathyaprakash_0-1670326377647.png

 

Avatar

Employee Advisor

@sathyaprakash Assets HTTP API is meant for CRUD operations. For Fetching such information, we need to use a Query Language and in case of Content Fragments, GraphQL is most apt.

Avatar

Correct answer by
Employee Advisor

Hi @sathyaprakash,

 

It's not available Out of the box in Assets API, As stated in the API Docs here "References are delivered as reference URLs". 

 

Please check the Assets API documentation for content fragments.

https://developer.adobe.com/experience-manager/reference-materials/cloud-service/javadoc/assets-api-... 

 

Regards,

Nitesh