@Rezende, Fernando SBRASEP-STS/631 Thanks for reaching out. The code given above is a common way to authenticate and make requests to an API. However, there are a few things you might want to check:
Ensure that the client_id, client_secret, and subscription_key is correct. These are sensitive pieces of information that need to be accurate for the authentication to work.
Make sure the endpoint you’re using is correct.
Token URL ("https://login.microsoftonline.com/common/oauth2/token") which is used to get the token might vary based on the tenant ID. Please confirm this URL with your client. Sometimes, the token requires a scope to be defined. If that’s the case, you might need to add "scope": "your_scope" to your payload.
Please check any error messages you receive. They often provide clues about what’s going wrong.
You don’t necessarily need any Azure Tool or APIM setup on your local machine to call this API. Once you have the token, you should be able to make requests to the API from anywhere, including your Jupyter notebook.
do let me know incase of further queries, I would be happy to assist you.