Can I use the ImportList API call with opt out action with restricted databases?

Import List API and restricted databases

Symptoms

You have a Restricted List (Restricted - is a database that either uses a different field as the Primary Key instead of EMAIL or it uses EMAIL and 1 or more other fields combined to make a primary key. Therefore Duplicates of the Email address are allowed but no duplicates of the defined Primary key or combined key are allowed.)

You are performing an Import List API call using the ACTION of Opt Out and your intention is to opt out a number of contacts all at one time. And in the case of duplicate Email Addresses, you only want a specific instance to be opted out.

You have created your mapping file specifying the columns that define the primary key and you have placed this xml mapping file and the source file onto the FTP server and submitted the IMPORT_LIST API call.

However, you notice that either no records are opted out or all instances of a specific email address are opted out (if you supplied the email address in the source file and included it in your mapping file).

Resolving the problem

In the case of restricted databases, it is not possible to use the <IMPORT_LIST> API with a mapping file ACTION of OPT OUT to target a specific instance of an email address (assuming that there are duplicates).

Instead ALL Instances of the email address are Opted Out.

As per the API Guide for Import List API Call, you can only target specific instances of an email address with restricted databases (no primary key defined what so ever) and you use the SYNC_FIELDS element in the mapping:

'OPT_OUT - opt out any contact in the source file who is already in the database. Ignore contacts who exist in the source file but not the database. All contacts matching the provided Email Address will be opted out unless the database has no unique identifier and SYNC_FIELDS are provided.'

The only way to opt out a contact on an restricted database via API is by using the <OptOutRecipient> API call. However you can only pass details one contact at a time.