2

I am trying to hit the PATCH /contacts/v1/contacts endpoint and I keep getting the error below saying that I am missing the PrimaryKeyAttribute during validation but I'm not seeing that value being sent over in the documentation. Am I missing something in the JSON I am sending over?

ERROR

{
 "operationStatus":"FAIL",
 "rowsAffected":0,
 "contactTypeID":0,
 "isNewContactKey":false,
 "requestServiceMessageID":"b8e6f772-cc38-479e-834d-7e545f0908cd",
 "hasErrors":true,
 "resultMessages":
  [{
    "resultType":"Validation",
    "resultClass":"Error",
    "resultCode":"InvalidAttributeSet",
    "message":"The Attribute Set [MobilePush Demographics] has validation errors.",
    "innerResultMessages":
     [{
       "resultType":"Validation",
       "resultClass":"Error",
       "resultCode":"MissingPrimaryKeyAttribute",
       "message":"The Attribute Set did not contain a required Primary Key value. [DefinitionName: Application], [DefinitionID: d8235429-d4e0-e511-872f-8cdcd4aff2c1]"
      },
      {
       "resultType":"Validation",
       "resultClass":"Error",
       "resultCode":"MissingPrimaryKeyAttribute",
       "message":"The Attribute Set did not contain a required Primary Key value. [DefinitionName: Device ID], [DefinitionID: e0235429-d4e0-e511-872f-8cdcd4aff2c1]"}]
      },
      {
       "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":"e77115b7-c4ea-43ac-a851-b22bfd4ee487"
}

JSON

{
 "attributeSets":[
  {
   "items":[
    {
     "values":[
      {
       "name":"MemberID",
       "value":"1a931e69-5460-4315-9ec7-a62b009ac6d0"
      },
      {
       "name":"Email Address",
       "value":"me@malcolmmcfly.com"
      }
     ]
    }
   ],
   "name":"MobilePush Demographics"
  }
 ],
 "contactKey":"945f23b5-e5f2-46f2-be1b-6a45a15490a8"
}
  • What is the primary key in your data extension? Try including it in the payload – Samuel Dare Jul 31 '17 at 17:47
  • @Data_Kid I think the problem is that I'm not clear on what we are referring to as the primary key. The attributeSetDefinitions endpoint gives me back all the valid attributes sets, and for MobilePush Demographics, the key is: PushDemographics. – MalcolmMcFly Jul 31 '17 at 18:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.