Forum Discussion

KDM_HOSS's avatar
KDM_HOSS
Advocate I
4 years ago
Solved

Getting Token for API Dataflow Gateway Binding

I'm attempting to use the https://wabi-canada-central-redirect.analysis.windows.net/metadata/dataflows/settings/{dataflow GUID}/bind API, but I'm having issues with the access token. I can make the A...
  • KDM_HOSS's avatar
    3 years ago

    Update

    The API works. I've been using the API for over a year to handle automated dataflow gateway binding in various applications.

     

    Rough Outline

    To get the access token to use for the API you'll need a couple things to get it through the Microsoft.Identity.Client.

    Run API

    • Add an AuthenticationHeader to a HttpClient containing the access token.
    • Get the URL Base API path from monitoring network traffic when binding a dataflow to a gateway in PBI Online
    • URL will be "{Url base path}/metadata/dataflows/settings/{dataflow.ObjectId}/bind"
    • Content will be a json formatted string with Gateway ID
      • "{{""gatewayObjectId"":""{gateway.Id}""}}"
    • Post