Headless content fragment - Assets http API with content reference | Community
Skip to main content
New Participant
December 6, 2022
Solved

Headless content fragment - Assets http API with content reference

  • December 6, 2022
  • 2 replies
  • 980 views

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.
Best answer by nitesh_kumar-1

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

2 replies

nitesh_kumar-1
nitesh_kumar-1Accepted solution
Employee
December 7, 2022

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

krati_garg
Employee
December 6, 2022

@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

 

New Participant
December 6, 2022

@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

 

 

krati_garg
Employee
December 6, 2022

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