Content Fragments API | Community
Skip to main content
riballor
Level 3
March 17, 2025
Solved

Content Fragments API

  • March 17, 2025
  • 1 reply
  • 705 views

Im trying to the create cross-channel fragment by using APIs, but Im getting this error

 

Body: 

 

{ "name": "Cyber Monday Sale - Header !!", "description": "Cyber Monday Sale - Header Banner!!", "type": "html", "channels": [ "shared" ], "source": { "origin": "ajo", "metadata": {} }, "fragment": { "content": "<div> Hi {{profile.person.name}} its a great day to shop !! </div>", "editorContext": {} } }

 

Response:

        "additionalContext": {
            "errorList": "[{\"type\":\"https://ns.adobe.com/aep/errors/CJMMAS-1099-400\",\"title\":\"The channel value for the html fragment is invalid. Allowed channel value is email.\",\"status\":400,\"report\":{\"tenantInfo\":null,\"additionalContext\":{\"errorLevel\":\"ERROR\",\"variantId\":\"3c5d37df-254c-48c9-93c0-5725d79f7d56\",\"source\":\"FRAGMENT\",\"allowedChannelValue\":\"email\",\"type\":\"html\"}},\"error-chain\":null}]"
        }
    }
 
 
Best answer by riballor

@riballor The document mentions that fragments are available only for email channel. as of now. However, the API indicates that they support other channels as well. I suggest raising an Adobe support ticket to clarify this discrepancy


Hey @anuhya-y 

 

Here is the correct body to create Cross-Channel Fragments

{ "name": "Cyber Monday Sale - Header !!", "description": "Cyber Monday Sale - Header Banner!!", "type": "expression", "source": { "origin": "ajo", "metadata": { } }, "fragment": { "expression": "Hi {{profile.person.name}} its a great day to shop !!" }, "subType": "html", "channels": [ "shared" ] }

Also, the Adobe API Documentation was updated

1 reply

Anuhya-Y
Community Advisor
Community Advisor
March 17, 2025

change channel to "email" and try

 

{
   "name":"Cyber Monday Sale - Header !!",
   "description":"Cyber Monday Sale - Header Banner!!",
   "type":"html",
   "channels":[
      "email"
   ],
   "source":{
      "origin":"ajo",
      "metadata":{
         
      }
   },
   "fragment":{
      "content":"<div> Hi {{profile.person.name}} its a great day to shop !! </div>",
      "editorContext":{
         
      }
   }
}
riballor
riballorAuthor
Level 3
March 17, 2025

If I do this, it will generate a fragment that only works for emails and not cross-channel

Anuhya-Y
Community Advisor
Community Advisor
March 17, 2025