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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

0

List of Apps in my Organisation using Power BI REST APIs

Hi All,

I am trying to get a list of apps in my organisation using the Power BI rest APIs .

 

Link to the documentation : Apps - Get Apps - REST API (Power BI Power BI REST APIs) | Microsoft Docs

 

I have tried connecting to the URL using Odatafeed and Web connectors but keep facing the "Access is forbidden"

SaiSpandana2811_0-1638449144805.png

 

When I try with web api it is asking for a key. Can someone please help me how can I continue.

 

Please can someone assist how I can do that

Status: Delivered

Hi @SaiSpandana2811 

 

Please try to copy and paste the following M query to a Blank Query’s Advanced Editor .

vcazhengmsft_0-1638511041794.png

 

let

    getgroups_uri ="https://api.powerbi.com/v1.0/myorg/apps",

    GetGroups = Json.Document(Web.Contents(getgroups_uri,

                [

                Headers=

                    [

                    Authorization="Bearer "& "[replace with your Bear Token]"

                    ],

                ManualStatusHandling={400}

                ]

                )),

    value = GetGroups[value],

    #"Converted to Table" = Table.FromList(value, Splitter.SplitByNothing(), null, null, ExtraValues.Error),

    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"id", "isReadOnly", "name"}, {"id", "isReadOnly", "name"}),

    #"Renamed Columns" = Table.RenameColumns(#"Expanded Column1",{{"id", "Workspace ID"}, {"name", "Workspace name"}})

in

#"Renamed Columns"

 

After that, Edit credential at the step named GetGroups with Anonymous Authentication method.

vcazhengmsft_1-1638511041797.png

 

 

If you want to dynamically acquire Token, you need extra code.

 

Best Regards,

Community Support Team _ Caiyun

Comments
v-cazheng-msft
Community Support
Status changed to: Delivered

Hi @SaiSpandana2811 

 

Please try to copy and paste the following M query to a Blank Query’s Advanced Editor .

vcazhengmsft_0-1638511041794.png

 

let

    getgroups_uri ="https://api.powerbi.com/v1.0/myorg/apps",

    GetGroups = Json.Document(Web.Contents(getgroups_uri,

                [

                Headers=

                    [

                    Authorization="Bearer "& "[replace with your Bear Token]"

                    ],

                ManualStatusHandling={400}

                ]

                )),

    value = GetGroups[value],

    #"Converted to Table" = Table.FromList(value, Splitter.SplitByNothing(), null, null, ExtraValues.Error),

    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"id", "isReadOnly", "name"}, {"id", "isReadOnly", "name"}),

    #"Renamed Columns" = Table.RenameColumns(#"Expanded Column1",{{"id", "Workspace ID"}, {"name", "Workspace name"}})

in

#"Renamed Columns"

 

After that, Edit credential at the step named GetGroups with Anonymous Authentication method.

vcazhengmsft_1-1638511041797.png

 

 

If you want to dynamically acquire Token, you need extra code.

 

Best Regards,

Community Support Team _ Caiyun

SaiSpandana2811
Regular Visitor

@v-cazheng-msft : Thanks for the code, but I keep facing the same error, access to the resource is forbidden .

 

SaiSpandana2811_0-1638811114160.png

I am also a service admin now. Any pre -requisite steps I need to follow to be able to make this work