1

Hi i am trying to create a new Account via API. I found the sample code from the below link. But I don't where to get the account ID or Client ID as i am creating new account.When i tried sending dummy client id getting this error RequestID: d4fc3ea2-1c49-4a03-abee- Message: MemberID xxxxxx does not have access to ClientID[12345] PartnerClientKey[] UserID[] PartnerUserKey[] CustomerKey[] supplied in the Client object.

If anyone can share a sample .net code of creating and deactivating Account via API any help will be greatly appreciated Thanks in advance.

http://help.marketingcloud.com/en/technical_library/web_service_guide/technical_articles/adding_a_new_user_to_an_existing_account/

1 Answer 1

2

1) You should check your user permissions as described here.

2) You can also double check this by replacing the parameters with actual values for an existing record (instead of creating dummy)

ClientID
PartnerClientKey
UserID
PartnerUserKey
CustomerKey

Set these in the code below and it should work if you've the appropriate permissions fixed.

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 = "[email protected]";
        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 ...... ");
        }
    }
}
1
  • Can you let me know where can i find those values of partner keys(is this a external key or something different?).Appreciate your help
    – Deepak
    Commented Jul 6, 2016 at 18:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .