In my company's Email Marketing Cloud Account we have multiple accounts (that is business Units). In our earlier integration with SOAP API we were able access the objects in these business units through the API by providing an API User username and password.

But now we are trying to switch to use the FuelSDK-Python, we noticed that the clientId and clientSecret only lets you access a single account (one business Unit), which means we have to create clientId and clientSecret for each of our business Units. For us this isn't scalable because we have a lot of business Units and most times in a single request we are interacting with more than one.

So my question is, is there a way to integrate all of our business units with a single clientId and clientSecret, or with an API User username and password just like with the SOAP API

And I forgot to mention these business units are hierarchical in nature, so we have one top parent and then tree grows from there.


Ok fortunately We were able to figure it out. In summary the answer to my question is YES.

First: From the App Center We created an App and linked it to the Parent Business Unit. Then used the clientId and clientSecret that was generated.

Second: We found that FuelSDK-Python Source code did not support retrieving from sub business units/accounts, even though the objectsample file gave an example of how but it didn't work. The problem was that in the rest.py file in the ET_Get() class it was not setting the 'QueryAllAccounts' and 'ClientIDs' properties of the 'RetrieveRequest' Object.

so it should be doing something like this;

ws_retrieveRequest = auth_stub.soap_client.factory.create('RetrieveRequest')

ws_retrieveRequest.ClientIDs = [{'ID': 'xxxx', 'CustomerKey': 'xxxx'}] #either ID or CustomerKey must be provided

ws_retrieveRequest.QueryAllAccounts = True

Now of course the properties have to passed in as part of the init method params. So something like

def __init__(self, auth_stub, obj_type, props = None, search_filter = None, options = None, ClientIDs = [], QueryAllccounts = False):

So that's how We tweaked it and got it working. Hope this helps someone at least until the feature is fully implemented in the source code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.