Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

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

Avatar

Level 5

My content fragment looks like:

spidey1405_0-1665066015924.png

 

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?

 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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

View solution in original post

5 Replies

Avatar

Employee Advisor

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

Avatar

Level 5

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?

Avatar

Community Advisor

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

Avatar

Level 5

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

Avatar

Correct answer by
Employee Advisor

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