I have a script that updates the MPD (MobilePush Demographics Attribute) on the AllContacts List. I do this with a PATCH call to the contacts endpoint (https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/updateContacts.html).
This works without a problem if the MPD Attribute is empty on the Contact. However, if I try to update the existing MPD Attribute I recieve this error:
{
"operationStatus": "FAIL",
"rowsAffected": 0,
"contactTypeID": 0,
"requestServiceMessageID": "8f0a0e6b-ee59-47f8-87ca-7219c713b603",
"responseDateTime": "2021-12-15T02:59:41.2904604-06:00",
"hasErrors": true,
"resultMessages": [
{
"resultType": "Validation",
"resultClass": "Error",
"resultCode": "InvalidAttributeSet",
"message": "The Attribute Set [MobilePush Demographics] has validation errors.",
"innerResultMessages": [
{
"resultType": "Validation",
"resultClass": "Error",
"resultCode": "InvalidInnerValueAttribute",
"message": "[DefinitionKey: CreatedDate], [DefinitionName: Created Date], [DefinitionID: da41f36f-9d16-ea11-b82d-b88303587ab1] :: The Attribute has an 'Inner Value' that could not be parsed to the correct data type. [DefinitionName: Created Date], [DefinitionID: da41f36f-9d16-ea11-b82d-b88303587ab1]",
"innerResultMessages": [
{
"resultType": "Validation",
"resultClass": "Error",
"resultCode": "InvalidDate",
"message": ""
}
]
},
{
"resultType": "Validation",
"resultClass": "Error",
"resultCode": "InvalidInnerValueAttribute",
"message": "[DefinitionKey: ModifiedDate], [DefinitionName: Modified Date], [DefinitionID: e441f36f-9d16-ea11-b82d-b88303587ab1] :: The Attribute has an 'Inner Value' that could not be parsed to the correct data type. [DefinitionName: Modified Date], [DefinitionID: e441f36f-9d16-ea11-b82d-b88303587ab1]",
"innerResultMessages": [
{
"resultType": "Validation",
"resultClass": "Error",
"resultCode": "InvalidDate",
"message": ""
}
]
}
]
},
{
"resultType": "Operational",
"resultClass": "Error",
"resultCode": "Update Failed",
"message": "Update failed for one or more AttributeSets. Note: Updates aren't allowed on attributes that form the primary Key of the attributeset"
}
],
"serviceMessageID": "7d4272a7-8396-4d35-b699-1d62faa58a03"
}
This is the Payload that I sent in the PATCH rest call (wich works for creating the MPD Attribute):
{
"contactKey": "0030E000014AJw7QAG",
"attributeSets": [
{
"name": "MobilePush Demographics",
"items": [
{
"values": [
{
"name": "Application",
"value": "60fea8bf-1f51-44d0-8d27-3fb9aexxxxxx"
},
{
"name": "Device ID",
"value": "E94A5018D2D10A3EBFE4E71FBE9D4010C5AAF90123E02E80289380F91Dxxxxxx"
},
{
"name": "System Token",
"value": "cfGsADOSRveQGsT-j3GWfr:APA91bGxe4a5oKlbBLLF7jz3xcK5pqdU_-95OPCrEQiNv92LYJZBHskHjlX6gpIKxio6JqCfKvcQ2uoZF435bxf5qrR0kJqTsL_mXJUmTniRmaJ0WSlMLclvxwx2aW7Gtaa7qBxxxxxx"
},
{
"name": "Platform",
"value": "Android OS"
}
]
}
]
}
]}
Does anybody know why I receive this error message? Thank you in advance!
Best Answer
Thanks to Swati Mishra I found out that I have to add the Modified Date and Created Date to the Payload. Now it works and the Payload looks like this (in SSJS):