Forum Discussion

Dinesh09's avatar
Dinesh09
Frequent Visitor
2 years ago
Solved

API in dataflowgen2

How to access api data using bearer token in header. In power BI Desktop web connector is available but not in dataflowgen2. Web API connector is available in dataflowgen2 but there is no option in G...
  • miguel's avatar
    miguel
    2 years ago

    We are working on enabling custom connectors in Dataflow Gen2. Creating a custom connector would be the recommended way to securely store the token and use it for the calls needed to the API. We don't have an ETA that we can share at the moment on when it'll be available.

     

    However, it is technically possible to create your own custom M code to pass the bearer token as clear text and as part of your M code. We do not recommend as the token will not be secure and will simply be part of your M code, but it is technically possible to do this. A sample code is provided below:

    let
      Source = Json.Document(Web.Contents("https://api.XXX.com/", [RelativePath="v1/mycall", Headers=[#"Authorization"="Bearer XXXtokenXXX"]]))
    in
      Source