Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ClientID
- PartnerClientKey
- UserID
- PartnerUserKey
- CustomerKey
- public void testAddUserToAccount()
- {
- Account account = new Account();
- Account.ID=12334;
- if (account != null)
- {
- AccountUser accountUser = new AccountUser();
- accountUser.Name = "ACRUZ";
- accountUser.UserID = "ACRUZ";
- accountUser.IsAPIUser = true;
- accountUser.IsAPIUserSpecified = true;
- accountUser.IsLocked = false;
- accountUser.IsLockedSpecified = true;
- accountUser.Password = "XXX";
- accountUser.MustChangePassword = false;
- accountUser.MustChangePasswordSpecified = true;
- accountUser.Email = "acruz@example.com";
- UserAccess access = new UserAccess();
- //3 CLIENT_ADMIN Add Users to Account
- //4 PRO_ADMIN Create/View Accounts
- access.ID = 3;
- access.IDSpecified = true; //.Net specific
- accountUser.UserPermissions = new UserAccess[] {access};
- //This tells that create user in subaccount
- ClientID clientID = new ClientID();
- clientID.PartnerClientKey = "12345";
- clientID.IDSpecified = true;
- accountUser.Client = clientID;
- APIObject[] apiObjects = {accountUser};
- String requestId = null;
- String overAllStatus = null;
- CreateResult[] results = partnerAPIWse.Create(new CreateOptions(), apiObjects, out requestId, out overAllStatus);
- if (results != null)
- {
- foreach (CreateResult result in results)
- {
- Console.WriteLine();
- Console.WriteLine("Status Message ### " +
- result.StatusMessage);
- }
- }
- else
- {
- Console.Write("Error ...... ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement