SaiSpandana2811's avatar
SaiSpandana2811
Regular Visitor
4 years ago
Status:
Done

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"

 

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

2 Comments

  • v-cazheng-msft's avatar
    v-cazheng-msft
    Icon for Community Support rankCommunity Support
    Status changed:
    New
    to
    Done

    Hi SaiSpandana2811 

     

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

     

    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.

     

     

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

     

    Best Regards,

    Community Support Team _ Caiyun

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

     

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