Power BI authentication is described in Microsoft’s documentation, but may be quite annoying at the very beginning. I have some pieces of code to making it working.
You need to authenticate as regular human. MFA won’t work. As a result you will get access token.
To call any API you need to pass access token in the ‘Authorization’ header.