Expand my Community achievements bar.

SOLVED

How to use Content Fragment Model OpenAPI to update CF?

Avatar

Level 6

I am trying to leverage the new OpenAPIs to programatically update CF from AppBuilder runtime action. 

 

The Create Content fragment  API works correctly. I am able to create CF from Postman. But when I try the Update CF, it is failing with 412 stating If-Match header is failing. 

sarav_prakash_0-1726711356604.png

 

Now, the way I run is, I am calling List CF, getting the UUID of CF from response and passing to PUT request. I am reading If-Match header needs should be populated with `ETag`. But my List CF response is NOT returning any ETag as explained in documentation. This is the List CF response

sarav_prakash_2-1726711705307.png

Only an id is returned by GET method. If any additional headers required to force the GET method to return `ETag`. Or any alternate workaround to get past If-Match header validation? 

 

CORRECTION:

I was able to find the etag in the response header of GET CF<id> method. But this makes API more difficult to use. I only have CF path and want to patch update. The process sounds to be:

  1. Find CF ID using List
  2. Find etag using Get
  3. Edit CF using Patch.

If this the moving forward way to update CF even if we know exact CF path? 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @sarav_prakash ,

 

Short answer: Yes. My understanding of this behavior is that these new APIs adhere to OpenAPI specifications and are meant to be consistent across all other AEMaaCS solutions. The long answer can be found here: AEM Gems - 19th June 2024.

 

Additionally, since these APIs are still in development and being updated, Adobe encourages providing feedback on them. I highly recommend that you email the team responsible for the APIs at aem-apis@adobe.com to share your feedback. I agree that there should be a way to streamline those three call processes. If you receive any response from them, please post back for the community.

 

Hope this helps!



Esteban Bustamante

View solution in original post

5 Replies

Avatar

Correct answer by
Community Advisor

Hi @sarav_prakash ,

 

Short answer: Yes. My understanding of this behavior is that these new APIs adhere to OpenAPI specifications and are meant to be consistent across all other AEMaaCS solutions. The long answer can be found here: AEM Gems - 19th June 2024.

 

Additionally, since these APIs are still in development and being updated, Adobe encourages providing feedback on them. I highly recommend that you email the team responsible for the APIs at aem-apis@adobe.com to share your feedback. I agree that there should be a way to streamline those three call processes. If you receive any response from them, please post back for the community.

 

Hope this helps!



Esteban Bustamante

Avatar

Level 6

yup. looks like this is it. sounds like stuck with unfortunate option. I too have reached to my adobe CSM and ticket. i ll close once I hear back from them.

Avatar

Level 6

I am closing my question after I opened a suggestion idea in community. https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager-ideas/enhance-openapi-cont...

 

I have also mailed to aem-apis@adobe.com hoping to get acknowledgement. 

 

Thanks for support. 

Avatar

Community Advisor

You can possibly skip 1st step if you are creating the cf first and then trying to modify it as you will be getting the cf id in response for creation. Rest don't see any workaround. Still following this thread to see if anyone has anymore ideas. 

Avatar

Level 6

No I have update scenarios also. wer I wont create, just have to edit properties.