"List all Content Fragments" endpoint does not return proper ETag
I'm using Sites API to list and delete Content Fragments. In particular:
- 'List all Content Fragments" endpoint to get CFs to delete
- "Delete a Content Fragment" to delete each CF
For deletion endpoint, there are 2 required params:
- "fragmentId" in path
- "If-Match" in header
I'm getting values for these params from "List all Content Fragments" response for each CF.
Example of GET response:
{
"items": [
{
"path": "<...>",
"title": "<...>",
"description": "<...>",
"id": "1833c3df-1345-4c4d-84d5-211c1cc3cd1f",
"created": {},
"modified": {},
"status": "DRAFT",
"previewReplicationStatus": "NEVER_PUBLISHED",
"model": {},
"validationStatus": [],
"fields": [],
"variations": [],
"tags": [],
"references": [],
"fieldTags": [],
"etag": "\"a6b0c90be2c9222696e83ded059108e7\"",
"tagsCount": 0
}
]
}
Example of DELETE request:
curl -i -X DELETE \
'https://author-p56105-e395653.adobeaemcloud.com/adobe/sites/cf/fragments/1833c3df-1345-4c4d-84d5-211c1cc3cd1f?unlinkReferences=false' \
-H 'Authorization: Bearer <MY_JWT>' \
-H 'If-Match: \"a6b0c90be2c9222696e83ded059108e7\"'
As you see, I provide appropriate values for the request, but I'm getting "Precondition Failed" error:
{
"type": "https://api.adobeaemcloud.com/adobe/meta/errors/precondition_failed",
"title": "Precondition Failed",
"status": 412,
"detail": "If-Match header does not match the current ETag of the resource",
"requestId": "c647d94c-a91d-4be5-87a6-e52154f9c365"
}
What's the reason of such behavior? Why API returns not valid ETag value? How can I delete CF?
Notes
- As for today, getting individual CF ("Get a Content Fragment" endpoint) does not return `etag` at all
- ETag value from "List all Content Fragments" endpoint contains double quotes inside it (see my code snippet above) - is it expected?