Enabling access token generation and API interaction in Datahub with Python via requests package

Original Slack Thread

Dear all,
I’m new with datahub.
I managed to deploy it in my Mac laptop using docker and it works fine.
What I need is to manipulate it as much as possible via python API (using requests package)

I understand I need to create my personal access token (PAT), but I don’t understand what files need to be changed
In order to enable the “generate access token” button, I think I have to either:
• add an environment variable to GMS and frontend images or
• create a new yaml file and build the image from it?
Can you please help me with that?
Under /Users/<me>/.datahub/quickstart I have these files:
docker-compose.yml and quickstart_version_mapping.yaml

Thanks!

Hi there! <Metadata Service Authentication | DataHub Service Authentication> seems to be what you’re looking to enable. However if this is just a local test deployment, you need not enable it to interact with APIs, you can directly interact with them without a token with Metadata Service Authentication disabled.

Hi <@UV5UEC3LN>, thanks for your answer.
Right. but when I try to make a call from python I get a 401 errorattachment

You’re routing your request through the frontend, so it needs a frontend session. The openApi endpoints are available directly on GMS on port 8080 as well

it works!!! Thank you Ryan, have a good one :wink: