Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

dynamic web api source schedule refresh on powerbi service

Hello, I am having trouble in scheduling refresh to the web api source which is dynamically generated in powerquery with auth0 authentication. I tried few of the online solution recomended by MS blog...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous - it difficult to validate the following but I think it relates to the following line in the above:

    data_url = "https://api.websitename.com/im1/run/details?start_date=" & Start_Date_Parameter & "T12:00:20Z&end_date=" & End_Date_Parameter & "T12:00:20Z",

    The concatenation of the URL string including the "?start_date" may not work as Chris describes in his blog.  This component needs to be moved in the "Relative Path".  i.e. not included in the main URL.  This will allow Power BI to check the credentials based on the main url instead of the dynamic url that includes dates.

     

     

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous 

     

    Thanks! finally got it working after continuous try

     

    data_url = "https://api.websitename.io/im1/run/details",
    data_body = "{
    ""authorization"": """& AccessTokenHeader & """,
    ""content-type"": ""application/json"",
    ""CATEGORY-ID"":""" & Category_Parameter & """
    }",

    GetGroups = Json.Document(
    Web.Contents(
    data_url, [Query=[start_date=Start_Date_Parameter & "T12:00:20Z", end_date=End_Date_Parameter & "T12:00:20Z"],

    Headers = Json.Document(data_body)
    ]
    )
    )