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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Admin REST API Get Groups expand not working

Hello,

 

When using the Groups GetGroupsAsAdmin the API works when only calling https://api.powerbi.com/v1.0/myorg/admin/groups?%24top=5000. When I try and add $expand to the call, I am returned with the same json without the expand..

 

Here is an example of my result when using the expand ( https://api.powerbi.com/v1.0/myorg/admin/groups?%24top=5000&expand=users )

{
  "@odata.context": "http://wabi-us-north-central-redirect.analysis.windows.net/v1.0/myorg/admin/$metadata#groups",
  "@odata.count": 51,
  "value": [
    {
      "id": "0CB12EE6-D7CF-4FF4-BCFE-BDFE6EB635ED",
      "isReadOnly": false,
      "isOnDedicatedCapacity": false,
      "capacityMigrationStatus": "",
      "type": "Workspace",
      "state": "Active",
      "name": "UCM_Test"
    },
    {
      "id": "7DCED3FC-4A91-426D-A98A-B32A37365593",
      "isReadOnly": false,
      "isOnDedicatedCapacity": true,
      "capacityId": "7C9E6ACF-5FA0-40A0-B034-38F32292B127",
      "capacityMigrationStatus": "Migrated",
      "type": "Workspace",
      "state": "Active",
      "name": "DEMO"
    }
}

. You can see there is no users array in the returned object. 

Status: New
Comments
v-lili6-msft
Community Support

hi  @TexasBI 

 

Here is an example of my result when using the expand ( https://api.powerbi.com/v1.0/myorg/admin/groups?%24top=5000&expand=users )

 

Try it as this:

https://api.powerbi.com/v1.0/myorg/admin/groups?%24top=5000&$expand=users

 

URI Parameters

URI PARAMETERS
Name In Required Type Description
$top
query True
  • integer
int32

Returns only the first n results. This parameter is mandatory and must be in the range of 1-5000.

$expand
query  
  • string

Expands related entities inline, receives a comma-separated list of data types. Supported: users, reports, dashboards, datasets, dataflows, workbooks

https://docs.microsoft.com/en-us/rest/api/power-bi/admin/groups_getgroupsasadmin

 

 

Regards,

Lin

Anonymous
Not applicable

Hey @v-lili6-msft ,

 

I just tried using the URL again and here is my response. Please tell me what I did wrong?

Capture.PNG

Anonymous
Not applicable

Hey @v-lili6-msft ,

 

I just tired switching the position of the top and expand in the URL. So here is an example:

https://api.powerbi.com/v1.0/myorg/admin/groups?$expand=users&$top=5000

 

and this worked. You can test it on your side but I would inform the product team that they have a bug in the API and need to fix the web page where you test the API.

klinejordan
Advocate II

@TexasBI You need another $ in front of your expand - it should be "&$expand=" not "&expand="

Anonymous
Not applicable

Hey @klinejordan 

 

Thank you, The Power BI team should be notified then that they have a bug when you try to use the "try it" on the API website.