Merge or update members in a profile list table

New members can be added to an existing profile list and existing members in a profile list can be updated. For a given list, an array of record data that contain field names and their corresponding field values are specified.

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

REQUEST NOTES:

  • Up to 200 members can be handled per a single request.
  • The matchColumnName attributes can have the following possible values: RIID_, CUSTOMER_ID_, EMAIL_ADDRESS_, MOBILE_NUMBER_, EMAIL_MD5_HASH_, EMAIL_SHA256_HASH_
  • Limitations:

    • A combination of either of the email HASH keys or a combination of EMAIL_ADDRESS with either of the email HASH keys cannot be given as matchColumnNames at the same time.
    • When either of the email HASH keys exists as a match column, then only updates are possible. Set the corresponding value in insertOnNoMatch to false when using these columns as match columns.

Service URL:

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

Request Method:

POST

Request Header:

Authorization=<AUTH_TOKEN>

Content-Type=application/json

Request Body:

{
  "recordData": {
    "fieldNames": [
      "riid_",
      "mobile_number_",
      "email_address_"
    ],
    "records": [
      [
        "4094326",
        "9845349498",
        "ab.cd@gmail.com"
      ],
      [
        "4094327",
        "9844444444",
        "unknown@oracle.com"
      ],
      [
        "4094328",
        "9844444666",
        "abc@gmail.com"
      ],
      [
        "ssdcf",
        "9844444444",
        "xyz"
      ]
    ],
    "mapTemplateName": null
  },
  "mergeRule": {
    "htmlValue": "H",
    "optinValue": "I",
    "textValue": "T",
    "insertOnNoMatch": true,
    "updateOnMatch": "REPLACE_ALL",
    "matchColumnName1": "RIID_",
    "matchColumnName2": null,
    "matchOperator": "NONE",
    "optoutValue": "O",
    "rejectRecordIfChannelEmpty": null,
    "defaultPermissionStatus": "OPTIN"
  }
}

Sample Response in case of success:

RESPONSE NOTES:

  • 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, such as mapTemplateName and mergeRule, will mirror the valid values specified in the request payload or default to null/false in case of invalid values.
{
    "recordData": {
        "fieldNames": [
            "RIID_"
        ],
        "records": [
            [
                "2047888987"
            ],
            [
                "4094327"
            ],
            [
                "2047889007"
            ],
            [
                "MERGEFAILED: Record 3 = INVALID_PARAMETER: The value ssdcf is not valid for an integer field\n\n\r\n"
            ]
        ],
        "mapTemplateName": null
    },
    "mergeRule": {
        "textValue": "T",
        "insertOnNoMatch": true,
        "updateOnMatch": "REPLACE_ALL",
        "htmlValue": "H",
        "optinValue": "I",
        "matchColumnName1": "RIID_",
        "matchColumnName2": null,
        "matchOperator": "NONE",
        "optoutValue": "O",
        "rejectRecordIfChannelEmpty": null,
        "defaultPermissionStatus": "OPTIN",
        "matchColumnName3": null
    },
    "links": [
        {
            "rel": "self",
            "href": "/rest/api/v1.3/lists/Auto Filters List HA enabled/members",
            "method": "POST"
        },
        {
            "rel": "retrieveListRecipientsRIID",
            "href": "/rest/api/v1.3/lists/Auto Filters List HA enabled/members/<riid>",
            "method": "GET"
        },
        {
            "rel": "deleteListRecipientsRIID",
            "href": "/rest/api/v1.3/lists/Auto Filters List HA enabled/members/<riid>",
            "method": "DELETE"
        }
    ]
}

Sample Response in case of failure:

{
   "type": "",
   "title": "Invalid request parameters",
   "errorCode": "INVALID_PARAMETER",
   "detail": "matchColumnName1 in ListMergeRule is null or empty",
   "errorDetails": []
}