Expand my Community achievements bar.

Never miss an update of the Adobe Journey Optimizer Community Lens! Subscribe now to get the latest updates, insights, and highlights delivered straight to your inbox every time a new edition drops.
SOLVED

Content Fragments API

Avatar

Level 3

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}]"
        }
    }
 
 
1 Accepted Solution

Avatar

Correct answer by
Level 3

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

View solution in original post

6 Replies

Avatar

Community Advisor

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":{
         
      }
   }
}

Avatar

Level 3

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

Avatar

Community Advisor

Avatar

Level 3

riballor_0-1742213334984.pngriballor_1-1742213378546.png

 

If I change the type to expression it also doesn't work in the API. 

 

Avatar

Community Advisor

@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

Avatar

Correct answer by
Level 3

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