Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
Paulinabartus
New Member

Tokenized rest api with using RelativePath

Hi All,

hope somebody can help me. I cannot figure out how to use RelativePath in the below query. Could somebody have a look please? 

 

The initial problem here is that I am trying to connect powerBI with another tool using tokenized REST API. In powerBI service the data cannot be refreshed due to the dynamic data. 

Thank you in advance for help

 

 

let
    //Authentication
 
    //URI's - Best Practice to Filter Arch & Type in Resource URL
    token_uri = "https://axaxl.avolutionsoftware.com/api/Token", //<===parameter
    resource = "https://axaxl.avolutionsoftware.com/api/Components?$filter=ComponentTypeName eq 'Application' and ArchitectureName eq 'AXA XL Actual' &$expand=Properties($filter=Type eq 'Information'),InConnections($filter=ConnectionTypeName eq 'Requires' ; $expand=SourceComponent ;$filter=SourceComponent/ComponentTypeName eq 'Application')",
 
//<===parameter
 
    //User Details(Modify)
    username = "xxx", //<===parameter
    password = "xxx", //<===parameter
    grant_type = "password",
 
    // Build query string(Do Not Modify)
    query = Uri.BuildQueryString([
        username = username,
        password = password,
        resource = resource,
        grant_type = grant_type
    ]),
 
    // Build HTTP request
    options = [
        Headers = [Accept="application/json"],
        ManualStatusHandling={400}
    ],
    content = Text.ToBinary(query),
    request = Web.Contents(token_uri, options & [Content = content]),
 
    // Parse JSON response and extract access token
    response = Json.Document(request,65001),
    access_token = response[access_token],
    token = "Bearer " & access_token,
 
    Source = OData.Feed(resource, null, [Headers=[Authorization = token ]]),
    
   
in
    Source
1 REPLY 1
rubayatyasmin
Community Champion
Community Champion

Hi, @Paulinabartus 

 

your base URL is https://axaxl.avolutionsoftware.com/api/ and you want to access the endpoint Components, you would set RelativePath to "Components". But from your existing code, it seems like you are already specifying the complete URL in the resource variable, so you do not need this param. 

I found similar thread that might be helpful, 

https://community.fabric.microsoft.com/t5/Power-Query/How-to-use-Relative-Path/td-p/2673874

 

https://community.fabric.microsoft.com/t5/Power-Query/API-with-relative-path/td-p/1832792

 

https://community.fabric.microsoft.com/t5/Desktop/Parameter-in-base-url-Relative-path-DynamicDataSou...

 

rubayatyasmin_0-1689517080227.png

 


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.