on ‎2019 Oct 08 9:16 AM
Hello dear experts,
Could you help me please.I've tried to create new messages using endpoint /sap/opu/odata/sap/API_MKT_CAMPAIGN_MESSAGE_SRV/Messages with provided JSON and got 400 response with message "Message content can only be created for default language 'EN'." Do you have any examples of data that I can use for creating new messages? Or do you have any idea what is wrong with my data?
JSON:
{
"MessageName": "stringstringstring2",
"MarketingArea": "CXXGLOBAL",
"DefaultLanguage": "EN",
"IsTemplate": false,
"MessageContents": {
"results": [
{
"MessageBlocks": {
"results": [
{
"BlockType": "TEXT",
"MessageBlockContents": {
"results": [
{
"BlockContentConditionName": "",
"BlockContentHTMLString": "something",
"BlockPosition": 0,
"BlockContentType": "TEXT",
"BlockContentStyleClasses": "",
"BlockControl": "",
"BlockControlName": ""
}
]
}
}
]
}
}
]
}
}
Error:
{
"error": {
"code": "CL_API_MKT_CPG_MSG/011",
"message": {
"lang": "en",
"value": "Message content can only be created for default language "EN"."
},
"innererror": {
"application": {
"component_id": "CEC-MKT-API",
"service_namespace": "/SAP/",
"service_id": "API_MKT_CAMPAIGN_MESSAGE_SRV",
"service_version": "0001"
},
"transactionid": "<transactionid>",
"timestamp": "",
"Error_Resolution": {
"SAP_Transaction": "",
"SAP_Note": "See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"
},
"errordetails": [
{
"code": "CL_API_MKT_CPG_MSG/011",
"message": "Message content can only be created for default language "EN".",
"propertyref": "",
"severity": "error",
"transition": false,
"target": ""
}
]
}
}
}
Request clarification before answering.
Thank you! This works!
Also there is easier way to create message with content:
{
"MessageName": "string",
"MessageType": "EM",
"MarketingArea": "CXXGLOBAL",
"DefaultLanguage": "EN",
"MessageContents": {
"results": [
{
"LanguageCode":"EN",
"MessageContentHTMLString":"<!DOCTYPE html>\n<html ......"
}
]
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sergei,
add "LanguageCode":"EN" before MessageBlocks. It should work.
regards, Radim
{
"MessageName": "stringstringstring2",
"MarketingArea": "CXXGLOBAL",
"DefaultLanguage": "EN",
"IsTemplate": false,
"MessageContents": {
"results": [
{
"LanguageCode":"EN",
"MessageBlocks": {
"results": [
{
"BlockType": "TEXT",
"MessageBlockContents": {
"results": [
{
"BlockContentConditionName": "",
"BlockContentHTMLString": "something",
"BlockPosition": 0,
"BlockContentType": "TEXT",
"BlockContentStyleClasses": "",
"BlockControl": "",
"BlockControlName": ""
}
]
}
}
]
}
}
]
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.