= dmda.DomoTokenAuth(
token_auth =os.environ["DOMO_INSTANCE"],
domo_instance=os.environ["DOMO_ACCESS_TOKEN"],
domo_access_token )
Account Routes
Account Route Error Types
Retrieval Routes
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)
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
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)
Account_GET_Error
Account_GET_Error (res:domolibrary.client.ResponseGetData.ResponseGetDat a, account_id:int=None, message:str=None)
base exception
= (await get_available_data_providers(auth = token_auth)).response
providers
print(f"there are {len(providers)} available ")
0:5] pd.DataFrame(providers)[
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
await get_accounts(auth=token_auth)).response[0:5]) pd.DataFrame((
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 |
await get_oauth_accounts(auth=token_auth, debug_api=False)).response[0:5]) pd.DataFrame((
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'}] | [] | {} |
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
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
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}
= 1
oauth_account_id
(await get_oauth_account_by_id(
=token_auth,
auth=oauth_account_id,
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
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
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
= 45
account_id
await get_account_config(
(=token_auth,
auth=account_id,
account_id=False,
debug_api=False,
return_raw )).response
{'_search_metadata': {'account_id': 45,
'data_provider_type': 'google-spreadsheets'}}
= 1
oauth_account_id
= await get_oauth_account_by_id(
res =token_auth,
auth=oauth_account_id,
account_id=False,
debug_api
)
= res.response["dataProviderType"]
data_provider_type
(await get_oauth_account_config(
=token_auth,
auth=oauth_account_id,
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
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)
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)
generate_create_oauth_account_body
generate_create_oauth_account_body (account_name, data_provider_type, origin, config)
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)
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 |
generate_create_account_body
generate_create_account_body (account_name, data_provider_type, config_body)
Account_CreateParams_Error
Account_CreateParams_Error (message:str)
base exception
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"},
}
= await create_oauth_account(auth=token_auth, create_body=create_body)
res 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(
= res.response['id'],
account_id = token_auth
auth )
ResponseGetData(status=200, response='deleted account 67', is_success=True, parent_class=None)
UPDATE
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)
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)
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(
=token_auth,
auth=71,
account_id={"credentials": "abc123"},
config_body=False,
debug_api
)).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(
=token_auth,
auth=5,
account_id={"client_id": str(dt.datetime.now().strftime('%Y-%m-%d-%H%M'))},
config_body=False,
debug_api
)).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': {}}
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)
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(
=token_auth,
auth=71,
account_id=f"domolibrary test account - updated {dt.date.today()}",
account_name=False,
debug_api
)).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(
=token_auth,
auth=5,
account_id=f"domolibrary test account - updated {dt.date.today()}",
account_name=False,
debug_api
)).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
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)
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)
await get_account_accesslist(auth=token_auth, account_id=71)).response) pd.DataFrame((
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 |
await get_oauth_account_accesslist(auth=token_auth, account_id=5, return_raw = False)).response) pd.DataFrame((
type | id | accessLevel | name | |
---|---|---|---|---|
0 | USER | 1893952720 | OWNER | Jae Wilson1 |