0

I have a data extension with 2 fields/attributes. These 2 fields are string types and primary keys. According to documentation the request body for synchronous APIs request should be: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/postDataExtensionRowsetByKey.htm

Here is my request body:

[{
    "keys": {
        "My Key 1": "key value 1",
        "My Key 2": "key value 2"
    },
    "values":{}
}]

Result:

{
"message": "Unable to save rows for data extension ID d1c527ab-7f03-e911-8b2d-9c8e9920e9fc",
"errorcode": 10006,
"documentation": ""
}
  • Will your DE contain more fields or is will it always contain 2 keys that are primary keys? If you don't intend to extend it, do they even need to be primary keys? – Rufenstein Feb 12 at 8:40
  • I need only 2 and they must be primary keys. – Vlad Shpak Feb 12 at 8:49
  • If extend my Data Extension with one more field that is not primary key and call request where body also includes this field but in the values object - it works well. There is another way is to switch from sync request async. – Vlad Shpak Feb 12 at 8:52
  • Yes, I tried to do the same and adding another column seemed like the only option to solve this. It's as if the API endpoint requires a column that's not a primary key column. – Rufenstein Feb 12 at 9:40
  • I guess that is Salesforce bug, especially when it's possible through async requests. – Vlad Shpak Feb 12 at 9:44
0

After review and a few tests I must say that is a Salesforce bug. As temporary workaround until it's not fixed it requires adding at least one attribute to Data Extension that is not primary key and include its to the request body:

[{
"keys": {
    "My Key 1": "key value 1",
    "My Key 2": "key value 2"
},
"values":{
  "Temp Field": ""
}}]

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.