Use ClientID to control which account an object is associated with when using Marketing Cloud Engagement Enterprise, Enterprise 2.0, and Agency editions. To ensure the object is created in the right account, specify the client ID on all objects passed into the API.
When you provision an account through the API, you can set a PartnerKey for the account to identify it externally. Reference the PartnerKey in the ClientID object PartnerClientKey property. If you don't associate PartnerKey with the account, use the ClientID objectID property with your account ID as the value.
Marketing Cloud Engagement maintains the PartnerClientKey property for legacy functionality and backwards compatibility. To avoid performance issues, don't use this property in new code or integrations. Replace this property with ClientID whenever possible.
Sample .NET Code
These .NET code examples show how to use the ClientID in your code.
Authenticate to the SOAP API Using the Parent Account
// Initialize the web service proxy
PartnerAPIWse integrationFramework = new PartnerAPIWse();
// Set the username/password. This is using the Username token of WS-Security 1.0
UsernameTokenProvider utp = new UsernameTokenProvider("username", "password");
integrationFramework.SetClientCredential<UsernameToken>(utp.GetToken());
// Declare the policy
policy = new Policy(new UsernameOverTransportAssertion());
integrationFramework.SetPolicy(policy);
...
Create an Account with a Partner Key
Account account = new Account();
account.Name = "Account " + name;
account.PartnerKey = "12345"; // partner key eases the management of sub-accounts
account.FromName = "Account " + name;
Create a ClientID
ClientID clientId = new ClientID();
// Option #1 - Use Account ID
//clientId.ID = 12345;
//clientId.IDSpecified = true;
// Option #2 - Use the partner key you provided for the account
clientId.PartnerClientKey = "12345";
...
Create a List
List list = new List();
list.Client = clientID; // The owner of the list
list.PartnerKey = "121245"; // Your identifier for the list
list.ListName = "Campaign 1";
list.Description = "Subscriber in Campaign 1";
Retrieve a List from a Specific Account
ClientID rrclient = new ClientID();
rrclient.ID = 12345;
rrclient.IDSpecified = true;
rr.Options.Client = rrclient;
... // Retrive the list
or
ClientID[] clients = new ClientID[1];
clients[0] = new ClientID();
clients[0].ID = 12345;
clients[0].IDSpecified = true;
rr.ClientIDs = clients;
... // Retrive the list
SOAP Envelopes
Use ClientID in your SOAP calls differently, depending on the method. In each of these examples, notice the unique placement and usage of the Client property in the SOAP body.