Content Fragment HTTP API for Create returns 200 content modified response instead of 201
I'm trying to create a content Fragment with the HTTP API. I have generated the bearer token and I've set it to the request.
URL: https://{{bucket}}.adobeaemcloud.com/api/assets/myproject/new-cf
Body:
{
"properties": {
"description": "New Content Fragment Description",
"title": "New Content Fragment",
"name": "new-cf",
"cq:model": "/conf/myproject/settings/dam/cfm/models/samplemodel",
"elements": {
"title": {
"value": "Test Title for Content Fragment"
}
}
}
}
Response:
{
"class": [
"core/response"
],
"properties": {
"path": "/api/assets/myproject/new-name",
"parentLocation": "/api/assets/myproject.json",
"referer": "",
"changes": [],
"location": "/api/assets/myproject/new-name.json",
"status.message": "OK",
"title": "Content modified /api/assets/myproject/new-name",
"status.code": 200
}
}
I am getting this response instead of 201 content Created. The content fragment is not created in the assets as well.
However, when I create a new Content fragment using console and then use the GET API, I get a proper response.
Any idea on why this is happening? How can we ensure the content fragment gets created?