AEM Assets API - Throwing error when trying to create assets through POST request | Community
Skip to main content
Level 4
Oct 6, 2022 2:23 PM UTC
Solved

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

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.
joerghoh
joerghohAccepted solution
Employee
Oct 9, 2022 9:16 AM UTC

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

5 replies

HeenaMadan
New Participant
Oct 7, 2022 6:50 AM UTC

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

Translate
Level 4
Oct 7, 2022 8:18 AM UTC

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

Translate
joerghoh
joerghohAccepted solution
Employee
Oct 9, 2022 9:16 AM UTC

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

Translate
joerghoh
Employee
Oct 6, 2022 7:35 PM UTC

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

Translate
Level 4
Oct 7, 2022 8:37 AM UTC

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?

Translate