Account Routes

token_auth = dmda.DomoTokenAuth(
    domo_instance=os.environ["DOMO_INSTANCE"],
    domo_access_token=os.environ["DOMO_ACCESS_TOKEN"],
)

Account Route Error Types

Retrieval Routes


source

get_oauth_accounts

 get_oauth_accounts (auth:domolibrary.client.DomoAuth.DomoAuth,
                     debug_api:bool=False, debug_num_stacks_to_drop=1,
                     parent_class:str=None,
                     session:httpx.AsyncClient=None)

source

get_accounts

 get_accounts (auth:domolibrary.client.DomoAuth.DomoAuth,
               debug_api:bool=False, debug_num_stacks_to_drop=1,
               parent_class:str=None, session:httpx.AsyncClient=None)

retrieve a list of all the accounts the user has read access to. Note users with “Manage all accounts” will retrieve all account objects


source

get_available_data_providers

 get_available_data_providers (auth:domolibrary.client.DomoAuth.DomoAuth,
                               debug_api:bool=False,
                               debug_num_stacks_to_drop=1,
                               parent_class:str=None,
                               session:httpx.AsyncClient=None)

source

Account_GET_Error

 Account_GET_Error
                    (res:domolibrary.client.ResponseGetData.ResponseGetDat
                    a, account_id:int=None, message:str=None)

base exception

providers = (await get_available_data_providers(auth = token_auth)).response

print(f"there are {len(providers)} available ")
pd.DataFrame(providers)[0:5]
there are 1139 available 
id key name url defaultConnectorId defaultConnectorLabel authenticationScheme connectorValidatorPresent resourceBundlePresent moduleHandler ... unsafe scope producer version dateCreated dateUpdated visibility type customerOAuthConfigurationDataProviderType authenticationSchemeConfiguration
0 710 10k 10k http://www.10000ft.com/ com.domo.connector.10k None fields False False None ... False GLOBAL DOMO 0 1494789166000 1490641118000 WITH_CONNECTOR STANDARD None []
1 4792 test-temp-97e6f554-6000-4a7f-96ce-be4449fa30a7 2-7 test Third Party None None None None False False None ... False GLOBAL DOMO 0 1678915048000 1678915048000 WITH_CONNECTOR STANDARD None []
2 1269 abc-news-3a4136be-9552-4eed-a438-a07e7f723cc9 ABC News Third Party None com.thirdparty.connector.3a4136be-9552-4eed-a4... None None False False None ... False GLOBAL DOMO 0 1528294791000 1528201713000 WITH_CONNECTOR STANDARD None []
3 643 abs-indicators-abd9d37e-acb9-4677-9a70-7d680dd... ABS Indicators Third Party None None None None False False None ... False GLOBAL DOMO 0 1494789166000 1494789166000 WITH_CONNECTOR STANDARD None []
4 4876 abstract-credential-store Abstract Credential Store None None None fields False False None ... False GLOBAL DOMO 0 1672760351000 1672760351000 ALWAYS STANDARD None []
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
1134 3969 zoho-crm-enterprise Zoho CRM Enterprise None None None oauth-metadata False False None ... False GLOBAL DOMO 0 1639670245000 1698675058000 WITH_CONNECTOR STANDARD None []
1135 2995 zoom Zoom None None None oauth-metadata False False None ... False GLOBAL DOMO 0 1589920444000 1585174002000 WITH_CONNECTOR STANDARD None []
1136 237 zuora Zuora http://www.zuora.com/ com.domo.connector.zuora None fields False False ... False GLOBAL DOMO 0 1494789166000 1489127517000 WITH_CONNECTOR STANDARD None []
1137 454 zuora-l1 Zuora http://www.zuora.com/ com.domo.connector.zuora.l1 None fields False False None ... False GLOBAL DOMO 0 1494789166000 1494789166000 WITH_CONNECTOR STANDARD None []
1138 3317 random-c92acf60-d793-4541-ad9f-e4da94caddf7 ランダムコネクター Third Party None None None None False False None ... False GLOBAL DOMO 0 1604928989000 1604575624000 WITH_CONNECTOR STANDARD None []

1139 rows × 21 columns

sample implementation of get_accounts

pd.DataFrame((await get_accounts(auth=token_auth)).response[0:5])
id userId name displayName type valid dataProviderType credentialsType createdAt createdBy modifiedAt modifiedBy configurations accountId accountTemplateId accountTemplateAuthorizationId
0 5 1893952720 Domo Governance Datasets Third Party Account test_rename data True domo-governance-d14c2fef-49a8-4898-8ddd-f64998... fields 1616777681000 1893952720 1728351666000 1893952720 {} 5 None None
1 45 1893952720 onyxReporting@gmail.com test-goolesheets data True google-spreadsheets oauth 1664924354000 1893952720 1732825320000 1893952720 {} 45 None None
2 70 1893952720 jaemyong.wilson@sony.com jaemyong.wilson@sony.com data True google-spreadsheets oauth 1682511651000 1893952720 1731363771000 1893952720 {} 70 None None
3 71 1893952720 domo_creds domo_creds - update 2024-11-28 data True abstract-credential-store fields 1684447092000 1893952720 1732825941000 1893952720 {} 71 None None
4 87 1893952720 Abstract Credential Store Account jw_creds data True abstract-credential-store fields 1701447776000 1893952720 1702658176000 1893952720 {} 87 None None
pd.DataFrame((await get_oauth_accounts(auth=token_auth, debug_api=False)).response[0:5])
userId datasourceCount id name displayName type enabled dataProviderType credentialsType origin createdAt createdBy modifiedAt modifiedBy configurationsList owners configurationAsList configurations
0 612085674 0 1 OZ test OZ test data True snowflake-oauth-config oauth OAUTH_CONFIGURATION 1731503516000 612085674 1731505069000 612085674 [] [{'type': 'USER', 'id': '612085674'}] [] {}
1 1893952720 0 3 test_api test_api data True snowflake-oauth-config oauth OAUTH_CONFIGURATION 1731507343000 1893952720 1731507343000 1893952720 [] [{'type': 'USER', 'id': '1893952720'}] [] {}
2 1893952720 0 4 test_api test_api data True snowflake-oauth-config oauth OAUTH_CONFIGURATION 1731507679000 1893952720 1731507679000 1893952720 [] [{'type': 'USER', 'id': '1893952720'}] [] {}
3 1893952720 0 5 Jira On Prem OAuth Config OAuth Configuration domolibrary test account - updated 2024-11-28 data True jira-on-prem-oauth-config oauth OAUTH_CONFIGURATION 1731511049000 1893952720 1732823558000 1893952720 [] [{'type': 'USER', 'id': '1893952720'}] [] {}
4 1893952720 0 6 test_api test_dl data True snowflake-oauth-config oauth OAUTH_CONFIGURATION 1731513504000 1893952720 1731513504000 1893952720 [] [{'type': 'USER', 'id': '1893952720'}] [] {}

source

get_oauth_account_by_id

 get_oauth_account_by_id (auth:domolibrary.client.DomoAuth.DomoAuth,
                          account_id:int, debug_api:bool=False,
                          debug_num_stacks_to_drop:int=1,
                          parent_class:str=None,
                          session:httpx.AsyncClient=None,
                          return_raw:bool=False)

retrieves all_oauth_accounts and filters to the selected one. There does not appear to be an API implementation of retrieving one OAuth Account


source

get_account_by_id

 get_account_by_id (auth:domolibrary.client.DomoAuth.DomoAuth,
                    account_id:int, debug_api:bool=False,
                    debug_num_stacks_to_drop:int=1, parent_class:str=None,
                    session:httpx.AsyncClient=None)

retrieves metadata about an account


source

Account_NoMatch

 Account_NoMatch (res:domolibrary.client.ResponseGetData.ResponseGetData,
                  account_id=None, message='Account not found --  has it
                  been shared with the user?')

base exception

sample implementation of get_account_by_id

(await get_account_by_id(auth=token_auth, account_id=71)).response
{'id': 71,
 'userId': 1893952720,
 'name': 'domo_creds',
 'displayName': 'domo_creds - update 2024-11-28',
 'type': 'data',
 'valid': True,
 'dataProviderType': 'abstract-credential-store',
 'credentialsType': 'fields',
 'createdAt': 1684447092000,
 'createdBy': 1893952720,
 'modifiedAt': 1732825941000,
 'modifiedBy': 1893952720,
 'configurations': {},
 'accountTemplateId': None,
 'accountTemplateAuthorizationId': None,
 'accountId': 71}
oauth_account_id = 1

(
    await get_oauth_account_by_id(
        auth=token_auth,
        account_id=oauth_account_id,
    )
).response
{'userId': 612085674,
 'datasourceCount': 0,
 'id': 1,
 'name': 'OZ test',
 'displayName': 'OZ test',
 'type': 'data',
 'enabled': True,
 'dataProviderType': 'snowflake-oauth-config',
 'credentialsType': 'oauth',
 'origin': 'OAUTH_CONFIGURATION',
 'createdAt': 1731503516000,
 'createdBy': 612085674,
 'modifiedAt': 1731505069000,
 'modifiedBy': 612085674,
 'configurationsList': [],
 'owners': [{'type': 'USER', 'id': '612085674'}],
 'configurationAsList': [],
 'configurations': {}}

Account Config


source

get_oauth_account_config

 get_oauth_account_config (auth:domolibrary.client.DomoAuth.DomoAuth,
                           account_id:int, data_provider_type:str,
                           return_raw:bool=False, debug_api:bool=False,
                           debug_num_stacks_to_drop:int=1,
                           parent_class:str=None,
                           session:httpx.AsyncClient=None)

retrieves metadata about an account


source

get_account_config

 get_account_config (auth:domolibrary.client.DomoAuth.DomoAuth,
                     account_id:int, data_provider_type:str=None,
                     return_raw:bool=False, debug_api:bool=False,
                     debug_num_stacks_to_drop:int=1,
                     parent_class:str=None,
                     session:httpx.AsyncClient=None)

sample implementation of get_account_config

account_id = 45

(await get_account_config(
    auth=token_auth,
    account_id=account_id,
    debug_api=False,
    return_raw=False,
)).response
{'_search_metadata': {'account_id': 45,
  'data_provider_type': 'google-spreadsheets'}}
oauth_account_id = 1

res = await get_oauth_account_by_id(
    auth=token_auth,
    account_id=oauth_account_id,
    debug_api=False,
)

data_provider_type = res.response["dataProviderType"]

(
    await get_oauth_account_config(
        auth=token_auth,
        account_id=oauth_account_id,
        data_provider_type=data_provider_type,
    )
).response
{'client-secret': '123',
 'client-id': '123',
 '_search_metadata': {'account_id': 1,
  'data_provider_type': 'snowflake-oauth-config'}}

CRUD Routes

CREATE and Delete


source

delete_oauth_account

 delete_oauth_account (auth:domolibrary.client.DomoAuth.DomoAuth,
                       account_id:str, debug_api:bool=False,
                       debug_num_stacks_to_drop=1, parent_class:str=None,
                       session:httpx.AsyncClient=None)

source

create_oauth_account

 create_oauth_account (auth:domolibrary.client.DomoAuth.DomoAuth,
                       account_name:str=None, data_provider_type:str=None,
                       origin:str='OAUTH_CONFIGURATION', config:dict=None,
                       create_body:dict=None, debug_api:bool=False,
                       session:httpx.AsyncClient=None,
                       parent_class:str=None, debug_num_stacks_to_drop=1)

source

generate_create_oauth_account_body

 generate_create_oauth_account_body (account_name, data_provider_type,
                                     origin, config)

source

delete_account

 delete_account (auth:domolibrary.client.DomoAuth.DomoAuth,
                 account_id:str, debug_api:bool=False,
                 debug_num_stacks_to_drop=1, parent_class:str=None,
                 session:httpx.AsyncClient=None)

source

create_account

 create_account (auth:domolibrary.client.DomoAuth.DomoAuth,
                 account_name:str=None, data_provider_type:str=None,
                 config_body:dict=None, payload:dict=None,
                 debug_api:bool=False, session:httpx.AsyncClient=None,
                 parent_class:str=None, debug_num_stacks_to_drop=1)
Type Default Details
auth DomoAuth
account_name str None
data_provider_type str None
config_body dict None properly formatted AccountConfig
payload dict None final payload
debug_api bool False
session AsyncClient None
parent_class str None
debug_num_stacks_to_drop int 1
Returns ResponseGetData

source

generate_create_account_body

 generate_create_account_body (account_name, data_provider_type,
                               config_body)

source

Account_CreateParams_Error

 Account_CreateParams_Error (message:str)

base exception


source

Account_CRUD_Error

 Account_CRUD_Error
                     (res:domolibrary.client.ResponseGetData.ResponseGetDa
                     ta, account_id=None, message:str=None)

base exception

create_body = {
    "name": "test_api",
    "displayName": "test_dl",
    "dataProviderType": "snowflake-oauth-config",
    "origin": "OAUTH_CONFIGURATION",
    "configurations": {"client-id": "777", "client-secret": "777"},
}

res = await create_oauth_account(auth=token_auth, create_body=create_body)
res
ResponseGetData(status=200, response={'id': 67, 'name': 'test_api', 'displayName': 'test_dl', 'type': 'data', 'enabled': False, 'dataProviderType': 'snowflake-oauth-config', 'credentialsType': 'oauth', 'origin': 'OAUTH_CONFIGURATION', 'createdAt': None, 'createdBy': 1893952720, 'modifiedAt': None, 'modifiedBy': 1893952720, 'configurationsList': [], 'configurations': {}}, is_success=True, parent_class=None)
await delete_oauth_account(
    account_id = res.response['id'],
    auth = token_auth
)
ResponseGetData(status=200, response='deleted account 67', is_success=True, parent_class=None)

UPDATE


source

update_oauth_account_config

 update_oauth_account_config (auth:domolibrary.client.DomoAuth.DomoAuth,
                              account_id:int, config_body:dict,
                              data_provider_type:str=None,
                              debug_api:bool=False,
                              debug_num_stacks_to_drop:int=1,
                              parent_class:str=None,
                              session:httpx.AsyncClient=None)

source

update_account_config

 update_account_config (auth:domolibrary.client.DomoAuth.DomoAuth,
                        account_id:int, config_body:dict,
                        data_provider_type:str=None, debug_api:bool=False,
                        debug_num_stacks_to_drop:int=1,
                        parent_class:str=None,
                        session:httpx.AsyncClient=None)

source

Account_Config_Error

 Account_Config_Error
                       (res:domolibrary.client.ResponseGetData.ResponseGet
                       Data, account_id=None, message:str=None)

base exception

sample implementation of update_account

try:
    print((await update_account_config(
        auth=token_auth,
        account_id=71,
        config_body={"credentials": "abc123"},
        debug_api=False,
    )).response)

except Exception as e:
    print(e)
{'id': 71, 'userId': 1893952720, 'name': 'domo_creds', 'displayName': 'domo_creds - update 2024-11-28', 'type': 'data', 'valid': True, 'dataProviderType': 'abstract-credential-store', 'credentialsType': 'fields', 'createdAt': 1684447092000, 'createdBy': 1893952720, 'modifiedAt': 1732825941000, 'modifiedBy': 1893952720, 'configurations': {}, 'accountTemplateId': None, 'accountTemplateAuthorizationId': None, 'accountId': 71}
try:
    print((await update_oauth_account_config(
        auth=token_auth,
        account_id=5,
        config_body={"client_id": str(dt.datetime.now().strftime('%Y-%m-%d-%H%M'))},
        debug_api=False,
    )).response)

except Exception as e:
    print(e)
{'id': 5, 'name': 'Jira On Prem OAuth Config OAuth Configuration', 'displayName': 'domolibrary test account - updated 2024-11-28', 'type': 'data', 'enabled': True, 'dataProviderType': 'jira-on-prem-oauth-config', 'credentialsType': 'oauth', 'origin': 'OAUTH_CONFIGURATION', 'createdAt': 1731511049000, 'createdBy': 1893952720, 'modifiedAt': 1732823558000, 'modifiedBy': 1893952720, 'configurationsList': [], 'configurations': {}}

source

update_oauth_account_name

 update_oauth_account_name (auth:domolibrary.client.DomoAuth.DomoAuth,
                            account_id:int, account_name:str,
                            debug_api:bool=False,
                            debug_num_stacks_to_drop:int=1,
                            parent_class:str=None,
                            session:httpx.AsyncClient=None)

source

update_account_name

 update_account_name (auth:domolibrary.client.DomoAuth.DomoAuth,
                      account_id:int, account_name:str,
                      debug_api:bool=False,
                      debug_num_stacks_to_drop:int=1,
                      parent_class:str=None,
                      session:httpx.AsyncClient=None)

sample implementation of update_account_name

try:
    print((await update_account_name(
        auth=token_auth,
        account_id=71,
        account_name=f"domolibrary test account - updated {dt.date.today()}",
        debug_api=False,
    )).response)

except Exception as e:
    print(e)
{'id': 71, 'userId': 1893952720, 'name': 'domo_creds', 'displayName': 'domolibrary test account - updated 2024-11-28', 'type': 'data', 'valid': True, 'dataProviderType': 'abstract-credential-store', 'credentialsType': 'fields', 'createdAt': 1684447092000, 'createdBy': 1893952720, 'modifiedAt': 1732826507000, 'modifiedBy': 1893952720, 'configurations': {}, 'accountTemplateId': None, 'accountTemplateAuthorizationId': None, 'accountId': 71}
try:
    print((await update_oauth_account_name(
        auth=token_auth,
        account_id=5,
        account_name=f"domolibrary test account - updated {dt.date.today()}",
        debug_api=False,
    )).response)

except Exception as e:
    print(e)
{'id': 5, 'name': 'Jira On Prem OAuth Config OAuth Configuration', 'displayName': 'domolibrary test account - updated 2024-11-28', 'type': 'data', 'enabled': True, 'dataProviderType': 'jira-on-prem-oauth-config', 'credentialsType': 'oauth', 'origin': 'OAUTH_CONFIGURATION', 'createdAt': 1731511049000, 'createdBy': 1893952720, 'modifiedAt': 1732826507000, 'modifiedBy': 1893952720, 'configurationsList': [{'id': None, 'name': 'client_id', 'value': '{encrypted}M2FiNWZkYzItNDU5Yy00NDJhLWEzZjktZGEwMjdjNDdhOWI43Nmb/ebC9N0Jnh0AlyossBktax599LaSSNBxp6+YmUo='}, {'id': None, 'name': 'client_secret', 'value': '{encrypted}ODIzOGY3MjQtNjM4Yy00YjkxLTk0ZDItM2Q3NzhiOTU1YjM095NmBv0/cS5RogukZ5DdxdfvZ7K6URQ/d1HgQlcrEak='}], 'configurations': {'client_secret': '{encrypted}ODIzOGY3MjQtNjM4Yy00YjkxLTk0ZDItM2Q3NzhiOTU1YjM095NmBv0/cS5RogukZ5DdxdfvZ7K6URQ/d1HgQlcrEak=', 'client_id': '{encrypted}M2FiNWZkYzItNDU5Yy00NDJhLWEzZjktZGEwMjdjNDdhOWI43Nmb/ebC9N0Jnh0AlyossBktax599LaSSNBxp6+YmUo='}}

Account Sharing


source

get_oauth_account_accesslist

 get_oauth_account_accesslist (auth:domolibrary.client.DomoAuth.DomoAuth,
                               account_id:str, return_raw:bool=False,
                               debug_api:bool=False,
                               debug_num_stacks_to_drop:int=1,
                               parent_class:str=None,
                               session:httpx.AsyncClient=None)

source

get_account_accesslist

 get_account_accesslist (auth:domolibrary.client.DomoAuth.DomoAuth,
                         account_id:str, debug_api:bool=False,
                         debug_num_stacks_to_drop:int=1,
                         parent_class:str=None,
                         session:httpx.AsyncClient=None,
                         return_raw:bool=False)
pd.DataFrame((await get_account_accesslist(auth=token_auth, account_id=71)).response)
type id accessLevel name
0 GROUP 1814479647 CAN_VIEW Admin Test
1 USER 233216585 CAN_VIEW test - updated via dl 2024-11-28
2 USER 55874022 CAN_VIEW Grant Smith
3 USER 1893952720 OWNER Jae Wilson1
4 USER 1216550715 OWNER 8:26 - go to sleep
pd.DataFrame((await get_oauth_account_accesslist(auth=token_auth, account_id=5, return_raw = False)).response)
type id accessLevel name
0 USER 1893952720 OWNER Jae Wilson1

source

ShareAccount_AccessLevel

 ShareAccount_AccessLevel (value, names=None, module=None, qualname=None,
                           type=None, start=1)

Enum that correlates to the v2 API which should also be the current version


source

ShareAccount_V1_AccessLevel

 ShareAccount_V1_AccessLevel (value, names=None, module=None,
                              qualname=None, type=None, start=1)

An enumeration.


source

ShareAccount

 ShareAccount ()

Initialize self. See help(type(self)) for accurate signature.


source

share_oauth_account

 share_oauth_account (auth:domolibrary.client.DomoAuth.DomoAuth,
                      account_id:str, share_payload:dict,
                      debug_api:bool=False, parent_class:str=None,
                      debug_num_stacks_to_drop=1,
                      session:httpx.AsyncClient=None)

source

share_account

 share_account (auth:domolibrary.client.DomoAuth.DomoAuth, account_id:str,
                share_payload:dict, debug_api:bool=False,
                parent_class:str=None, debug_num_stacks_to_drop=1,
                session:httpx.AsyncClient=None)

for simplicity, this is the v2 api which should have been deployed to all Domo instances as of DP24


source

Account_AlreadyShared_Error

 Account_AlreadyShared_Error
                              (res:domolibrary.client.ResponseGetData.Resp
                              onseGetData, account_id:int=None,
                              message:str=None)

base exception


source

Account_Share_Error

 Account_Share_Error
                      (res:domolibrary.client.ResponseGetData.ResponseGetD
                      ata, account_id:int=None, message:str=None)

base exception

user_id = 929336557

share_payloads = [
    ShareAccount_AccessLevel.CAN_VIEW.generate_payload(user_id=user_id),
    ShareAccount_AccessLevel.NO_ACCESS.generate_payload(user_id=user_id),
]

account_id = 5

for payload in share_payloads:
    print((await share_oauth_account(
        auth=token_auth,
        account_id=account_id,
        share_payload=payload,
        debug_api=False,
    )).response)


source

share_account_v1

 share_account_v1 (auth:domolibrary.client.DomoAuth.DomoAuth,
                   account_id:str, share_payload:dict,
                   debug_api:bool=False, debug_num_stacks_to_drop:int=1,
                   parent_class:str=None, session:httpx.AsyncClient=None)

V1 API allows sharing with users ONLY. it does not support sharing with groups and has a more limited set of share rights (owner or read) see ShareAccount_V1_AccessLevel vs v2