Background and setup: I created a client using developer.domo.com and gave it the "data" scope. I have a client ID and secret now. I have tested it using the PyDomo library and it has worked. However, my goal is to programmatically get and store dataflows as an off-Domo backup. Domolibrary was recommended in another thread. I'm trying to use DomoDeveloperAuth in domolibrary, as it appears to allow use of client ID and secret. I'm following this snippet.
Problem: I'm not all that familiar with await— I'm trying to learn more Python at the same time— but it appears to require the asyncio library and applies to functions, like this:
import asyncio
async def my_function():
response = await <call that we need to wait for>
return response
So, perhaps incorrectly, I assumed that the code in the snippet needs to be placed in a function, like this:
import asyncio
import domolibrary.client.DomoAuth as dmda
async def fetch_auth_token(domo_client_id, domo_client_secret):
try:
domo_auth = dmda.DomoDeveloperAuth(
domo_client_id=domo_client_id,
domo_client_secret=domo_client_secret)
await domo_auth.get_auth_token()
except InvalidCredentialsError as e:
print(e)
domo_client_id = '<my_client_id>'
domo_client_secret = '<my_client_secret>'
asyncio.run(fetch_auth_token(domo_client_id, domo_client_secret))
When I run that, I get the error: "AttributeError: 'DomoDeveloperAuth' object has no attribute 'set_manual_login'. Did you mean: 'url_manual_login'?
". I don't know where to go from there. Is domolibrary using a deprecated API option? Do I have this set up completely wrong? Thanks in advance for any pointers.