AEM Assets API - Throwing error when trying to create assets through POST request | Community
Skip to main content
October 6, 2022
Solved

AEM Assets API - Throwing error when trying to create assets through POST request

  • October 6, 2022
  • 2 replies
  • 1954 views

My content fragment looks like:

 

And I am trying to add a content fragment to one of my asset folders like this:

POST `https://<HOST>.adobeaemcloud.com/api/assets/rallyhealth/ichabod/en/dev-migrations/test-cfx.json`

BODY:

{ "properties": { "description": "This is a Mutation Example", "cq:model": "/conf/rallyhealth/ichabod/settings/dam/cfm/models/test-cf-model", "title": "Mutation Example", "elements": { "title": { "value": "Mutation Title-01" }, "story": { "value": "Mutation Uri" } } } }

But it fails with:

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link rel="stylesheet" href="https://errors.adobeaemcloud.com/src.status.css"> </head> <body> <noscript>AEM Cloud Service.</noscript> <div id="root" status="500" backend="ddfa3fc56fc90e87f4884f81eab4605c--F_Skyline_Origin_Ingress_Author" healthy="1" gen="0" rid="c64d8acf-c02e-4486-a683-46491086cfd9" xid="64931826" age="0.000" ttl="0.000" restarts="0" nobranding="true" statusApi=""> </div> <script src="https://errors.adobeaemcloud.com/src.status.js"> </script> </body> </html>

I wish AEM errors were more descriptive. Can someone help me figure out what's going wrong?

 

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 joerghoh

I would specifically look for an exception for a POST request in your logs; more specifically it should reference the package name "org.apache.sling.servlets.post".

2 replies

joerghoh
Adobe Employee
Adobe Employee
October 6, 2022

You should be able to find an exception in the logs of the respective service (author or publish).

October 7, 2022

I downloaded logs but its pretty hard to find which one is the one triggered by mine. Can I use any correlation id or something to find the correct logs?

HeenaMadan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
October 7, 2022

You can check error logs. It will give you descriptive info. Share logs.

October 7, 2022

The logs are too much to be shared here. Can we not search piece of logs through the info we get in 500 response?

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
October 9, 2022

I would specifically look for an exception for a POST request in your logs; more specifically it should reference the package name "org.apache.sling.servlets.post".