Forum Discussion

ANNOAH's avatar
ANNOAH
New Member
4 years ago
Solved

How to connect a Rest API with variable path parameters as endpoints in URL with Power BI?

Hi, I would like to connect a GET request with variable endpoints in the URL to Power BI, the url has a structure as the following:   https://test.com/name/server/api/1   The endpoint is a varia...
  • Anonymous's avatar
    Anonymous
    4 years ago

    HI ANNOAH,

    You can create a query aptamer with text type and invoke it in your query table steps, then you can change the query parameter by rest API to dynamic affect the data source target:

    let
        Path = "/name/server/api/" & Parameter,
        Result =
            Web.Contents(
                "https://test.com",
                [
                    Headers = [
                        Authorization = "Bearer " + token,
                        RelativePath = Path
                    ]
                ]
            )
    in
        Result

    Datasets - Update Parameters In Group - REST API (Power BI Power BI REST APIs) | Microsoft Docs

    Regards,

    Xiaoxin Sheng