Headless content fragment - Assets http API with content reference | Community
Skip to main content
Level 2
Dec 6, 2022 9:43 AM UTC
Solved

Headless content fragment - Assets http API with content reference

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:

Graphql Response:

 

 

Assest API : Rest Call

 

 

 

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
nitesh_kumar-1
nitesh_kumar-1Accepted solution
Employee
Dec 7, 2022 6:02 PM UTC

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-content-fragments/index.html#/%7BcfParentPath%7D/getContentFragment 

 

Regards,

Nitesh

4 replies

nitesh_kumar-1
nitesh_kumar-1Accepted solution
Employee
Dec 7, 2022 6:02 PM UTC

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-content-fragments/index.html#/%7BcfParentPath%7D/getContentFragment 

 

Regards,

Nitesh

Translate
krati_garg
Employee
Dec 6, 2022 10:14 AM UTC

@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-api/sample-queries.html?lang=en#sample-wknd-fragment-specific-model-content-reference

 

Translate
Level 2
Dec 6, 2022 11:33 AM UTC

@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

 

 

Translate
krati_garg
Employee
Dec 6, 2022 2:33 PM UTC

@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.

Translate