[Found the answer for this, may be this will help others.]
Using the Bulk API, I was able to unsubscribe contacts globally by
setting the {{Contact.Email.IsSubscribed}} field. I am not entirely
sure if this is the right way to do it. But it works fine!
Here's the C# sample code:
// Define the list of fields that will be used in the data import
Dictionary<string, string> fields = new Dictionary<string, string>
{
{"C_EmailAddress", "{{Contact.Field(C_EmailAddress)}}"},
{"C_FirstName", "{{Contact.Field(C_FirstName)}}"},
{"C_LastName", "{{Contact.Field(C_LastName)}}"},
{"C_IsSubscribed", "{{Contact.Email.IsSubscribed}}"} // The Global Unsubscription field
};
// Create the definition (structure) of the import
var importUri = _contactImportHelper.CreateImportStructure(fields);
// Contact data to be imported
Dictionary<string, string> data1 = new Dictionary<string, string>
{
{"C_EmailAddress", "test1@test.com"},
{"C_FirstName", "Test1First"},
{"C_LastName", "Test1Last"},
{"C_IsSubscribed", "false"}
};
Dictionary<string, string> data2 = new Dictionary<string, string>
{
{"C_EmailAddress", "test2@test.com"},
{"C_FirstName", "Test2First"},
{"C_LastName", "Test2Last"},
{"C_IsSubscribed", "true"}
};
List<Dictionary<string, string>> list = new List<Dictionary<string, string>>
{
data1,
data2
};
Sync sync = _contactImportHelper.ImportData(importUri, list);
Below is the Link:
https://community.oracle.com/thread/3655521
Read Seema menon answer.