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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
dinoscool3
Helper II
Helper II

Anonymous Credintials when credentials are in query

I have a connection to some data on a forum. The credntials to connection (username, API) are in the query that I'm using, and then I connect using annonymous credentials.

 

This works fine on Desktop. However, on the web version and in dataflows it won't save properly. It only saves the credentials dataflow by dataflow, so I can't copy a dataflow easily. And I can't set up automatic refresh from the desktop connector.

 

How can I connect once without having to connect again and again and allow for automatic updates, its very tedious

 

An example of my query is here:

 

= (queryID) => let
        resultCount = 1000,
        otherNameForPage = 0,

        GetPage = (otherNameForPage) =>
            let
                content1 = "params={""page"":""" & Number.ToText(otherNameForPage) & """}",
                RawData = Json.Document(Web.Contents(
                    "https://test.com/admin/plugins/explorer/queries",
                    [RelativePath=Number.ToText(queryID) & "/run",
                        Query=
                        [
                            params="{""page"":""" & Number.ToText(otherNameForPage) & """}"
                        ],

                        Headers = [ 
                        #"api-username"="XXX",
                        #"api-key"="XXX",
                        #"Content-Type" = "application/x-www-form-urlencoded"],
                        Content = Text.ToBinary(content1)
                    ]
                    
                ) ),
                resultCount = RawData[result_count]
            in
                if RawData[result_count] = 0 then null else RawData,
            Pages = List.Generate(
                () => [i = 0, RawData = GetPage(i)],
                each [RawData] <> null,
                each [i=[i]+1, RawData = GetPage(i)],
                each Table.Combine(let raw = [RawData] in List.Transform(raw[rows], each Table.FromRows({_}, raw[columns])))),
            Output = Table.Combine(Pages)
in
    Output
1 REPLY 1
Anonymous
Not applicable

Hi @dinoscool3 

If you can use anonymous authentication to access root url of your api, you are able to use anonymous authentication to refresh dataset in Power BI Service .

I searched a similar issue , you can refer to it .

https://community.powerbi.com/t5/Service/Power-BI-Service-Refresh-of-data-on-API-using-POST-method/m...

https://powerbiexperience.com/en/how-to-get-and-automatically-refresh-apis-data/

 

Best Regard

Community Support Team _ Ailsa Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.