Merge or update members in a profile extension table

For an existing profile extension table, you can add new members or update data for existing members.

REQUEST NOTE: When creating a new profile extension table, the supported field types are:

  • The service URL requires the names of both the Profile List and the Profile Extension Table.
  • Up to 200 members can be processed in a single request.
  • Up to two match columns can be used for merging records into a profile extension table. If only one match column is specified, the other match column can be set to null.
  • For a given profile extension table, an array of record data that contain field names and their corresponding field values are specified. The fieldNames attribute must contain at least one of the merge key fields from the profile list (for example, RIID_, EMAIL_ADDRESS_, CUSTOMER_ID_), otherwise the request will result in a MERGEFAILED error.
  • matchColumnName1 and matchColumnName2 values must not contain the usual trailing underscore for the enumerated values. For example, RIID works but RIID_ results in an INVALID_PARAMETER error (“Match Column is null”). matchColumnName values can be as follows: RIID, CUSTOMER_ID, EMAIL_ADDRESS, MOBILE_NUMBER, EMAIL_MD5_HASH, or EMAIL_SHA256_HASH
  • Limitation for match columns: New records will not be inserted for insertOnNoMatch if a matchColumnName is either EMAIL_MD5_HASH or EMAIL_SHA256_HASH, even if matching records are not found in the table. The email hash attributes (EMAIL_MD5_HASH or EMAIL_SHA256_HASH) are only used for updating existing records.

Please see the definition of merge rule parameters provided in Definitions of Rule Parameters for Merging Members into a Profile List.

Service URL:

/rest/api/v1.3/lists/{listName}/listExtensions/{petName}/members

Request Method:

POST

Request Header:

Authorization=<AUTH_TOKEN>
Content-Type=application/json

Request Body:

{
		 "recordData" : {
		  "fieldNames" : ["riid_", "email_address_", "salary"],
		  "records" : [
                         ["1761408", "foo@bar.com", "10000"],
                         ["98798", "baz@foo.com", "298909"],
                         ["xyz", "bar@baz.com", "wedrfwe"],
                         ["12312", "bar@foo.com", "23423","23423"],
                         ["1761409","foo@baz.com", "239482734"]
                      ],
			"mapTemplateName" : null
		 },
		 "insertOnNoMatch" : true,
		 "updateOnMatch" : "REPLACE_ALL",
		 "matchColumnName1" : "RIID",
		 "matchColumnName2" : "EMAIL_ADDRESS"
}

Sample Response in case of success:

  • Irrespective of what field names were used to perform the merge, the response will always contain only RIID_ in the fieldNames attribute and the corresponding RIID_ values for the records in the records attribute.
  • In case merge failed for a record, the RIID_ of the record is not present in the response. Instead, an error message starting with MERGEFAILED: is returned. Client developers can look for the string MERGEFAILED: in the response for a particular row to determine whether that recipient was merged successfully or not.
  • The order of records in the response matches the order of records specified in the request payload. Furthermore, other attributes in the response like mapTemplateName, insertOnNoMatch, updateOnMatch, matchColumnName1, and matchColumnName2 will mirror the valid values specified in the request payload or default to null/false in case of invalid values.
{
   "recordData":    {
      "fieldNames": ["RIID_"],
      "records":       [
         ["1761408"],
         ["MERGEFAILED: Record 1 = RECORD DOES NOT MATCH ANY CONTACTS IN THE LIST DemoNewsLetterList\r\n"],
         ["MERGEFAILED: Record 2 = ERROR: The value xyz is not valid for an integer field\n\n\r\n"],
         ["MERGEFAILED: Record 3 = Field Names length, doesn't match with Field Values length\r\n"],
         ["1761409"]
      ],
      "mapTemplateName": null
   },
   "insertOnNoMatch": true,
   "updateOnMatch": "REPLACE_ALL",
   "matchColumnName1" : "RIID",
   "matchColumnName2" : "EMAIL_ADDRESS"
   "links":    [
      {
         "rel": "self",
         "href": "/rest/api/v1.3/lists/DemoNewsLetterList/listExtensions/DemoNewsLetterPet/members",
         "method": "POST"
      },
      {
         "rel": "retrieveProfileExtensionRecipientsRIID",
         "href": "/rest/api/v1.3/lists/DemoNewsLetterList/listExtensions/DemoNewsLetterPet/members/<riid>",
         "method": "GET"
      },
      {
         "rel": "deleteProfileExtensionRecipientsRIID",
         "href": "/rest/api/v1.3/lists/DemoNewsLetterList/listExtensions/DemoNewsLetterPet/members/<riid>",
         "method": "DELETE"
      }
   ]
}

Sample Response in case of failure:

{
   "type": "",
   "title": "Invalid request parameters",
   "errorCode": "INVALID_PARAMETER",
   "detail": "Match Column is null",
   "errorDetails": []
}