Opts in a given contact to preferences, or opts out a given contact from preferences
This method opts in a given contact to preferences, or opts out a given contact from preferences.
Opting in contacts to a preference
- Set the
isOptedIn
key totrue
Opting out contacts from a preference
- Set the
isOptedIn
key tofalse
SOAP action: http://apiconnector.com/v2/ApiService/SetPreferencesForContact
Input and output parameters
Input parameters
- ContactID - integer or ContactEmailAddress - string
- PreferenceID - integer
- IsPreference - boolean
- IsOptedIn - boolean
Output parameters
- PreferenceID - integer
- IsPreference - boolean
- IsOptedIn - boolean
Example
using (var client = new ApiServiceClient())
{
client.ClientCredentials.UserName.UserName = "username";
client.ClientCredentials.UserName.Password = "password";
var contactId = 8545;
var preferences = client.GetContactPreferencesByIDAsync(contactId).Result;
preferences[0].Preferences[0].IsOptedIn = true;
preferences[0].Preferences[1].IsOptedIn = true;
client.SetPreferencesForContactAsync(contactId, preferences).Wait();
}