Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

dynamic url for api calls using Web.Content

hello everyone,

anyone who worked with api calls using web.contents has definetly fell into the big issue when publishing to power bi service and setting incremental refresh with the error "data uses dynamic.." 

chris web solves it with relative path and query options and works well with static like api.site.com

however when it comes to jira

jira uses https://companyname.atlassian.net

so im forced to set url as dynamic for each client i have 

does anyone knows if jira has a url like github? 

github uses api.github.com/repos/orgname/reponame/issues...

so github would be easy to have dynamic url using the relative paths options 

Web.Contents("api.github.com", [RelativePath = "repos/" & [orgname] & "/" & [reponame] & "/issues", Query = [state="all"], Headers = [auth = [auth]])

this above is for github and works in powerbi service refresh and does incremintela refresh

its when you touch the base url like [companyname].atlassian.net things get messy

6 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      hello lbendlin, around 8 clients so its a hassle to just create around 7 tables for each client and then append them all

      • lbendlin's avatar
        lbendlin
        Super User

        Hassle maybe but doable. Would be a different story with hundreds of them.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

     

    If you want to refresh it in Power BI Service, the base URL must be static. Power BI will treat a base URL as a data source. 

     

    Jira has many kinds of APIs. Based on research, some of its APIs starts with "https://api.atlassian.com" but not sure if the resources you are querying has URLs of this structure. You may seek answers of this question at Atlassian Community.

     

    In addition, if the endpoints don't have such URLs with the same base URL, you may consider connecting to those URLs separately in different dataflows or semantic models. Then combine them into a single dataflow or semantic model for further reporting. If the number of companies is not large, this can be an alternative. What's more, if each company's endpoint requires different authentications, you will also have to treat them separately. The endpoint for authentication or getting a token might be different too. 

     

    Hope this would be helpful. 

     

    Best Regards,
    Jing
    If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

    • Anonymous's avatar
      Anonymous
      Not applicable

      hello Anonymous, thats what im doing at the moment but im trying to keep the data structure less laoding and less tables and appends