Skip to content

Latest commit

 

History

History
272 lines (191 loc) · 6.57 KB

GroupsApi.md

File metadata and controls

272 lines (191 loc) · 6.57 KB

GroupsApi

All URIs are relative to https://api.powerbi.com

Method HTTP request Description
addGroupUser POST /v1.0/myorg/groups/{groupId}/users Add a group user
createGroup POST /v1.0/myorg/groups Create new group
deleteGroup DELETE /v1.0/myorg/groups/{groupId} Deletes the specified group
deleteUserInGroup DELETE /v1.0/myorg/groups/{groupId}/users/{user} Deletes the specified group
getGroupUsers GET /v1.0/myorg/groups/{groupId}/users Get a group users list
getGroups GET /v1.0/myorg/groups Returns a list of groups

addGroupUser

Object addGroupUser(groupId, userDetails)

Add a group user

Example

// Import classes:
//import com.microsoft.powerbi.ApiException;
//import com.microsoft.powerbi.api.GroupsApi;


GroupsApi apiInstance = new GroupsApi();
String groupId = "groupId_example"; // String | The group id
GroupUserAccessRight userDetails = new GroupUserAccessRight(); // GroupUserAccessRight | user access right details
try {
    Object result = apiInstance.addGroupUser(groupId, userDetails);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GroupsApi#addGroupUser");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
groupId String The group id
userDetails GroupUserAccessRight user access right details

Return type

Object

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

createGroup

Group createGroup(requestParameters)

Create new group

Example

// Import classes:
//import com.microsoft.powerbi.ApiException;
//import com.microsoft.powerbi.api.GroupsApi;


GroupsApi apiInstance = new GroupsApi();
GroupCreationRequest requestParameters = new GroupCreationRequest(); // GroupCreationRequest | Create group request parameters
try {
    Group result = apiInstance.createGroup(requestParameters);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GroupsApi#createGroup");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
requestParameters GroupCreationRequest Create group request parameters

Return type

Group

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

deleteGroup

Object deleteGroup(groupId)

Deletes the specified group

Example

// Import classes:
//import com.microsoft.powerbi.ApiException;
//import com.microsoft.powerbi.api.GroupsApi;


GroupsApi apiInstance = new GroupsApi();
String groupId = "groupId_example"; // String | The group id to delete
try {
    Object result = apiInstance.deleteGroup(groupId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GroupsApi#deleteGroup");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
groupId String The group id to delete

Return type

Object

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

deleteUserInGroup

Object deleteUserInGroup(groupId, user)

Deletes the specified group

Example

// Import classes:
//import com.microsoft.powerbi.ApiException;
//import com.microsoft.powerbi.api.GroupsApi;


GroupsApi apiInstance = new GroupsApi();
String groupId = "groupId_example"; // String | The group id
String user = "user_example"; // String | The user email to delete
try {
    Object result = apiInstance.deleteUserInGroup(groupId, user);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GroupsApi#deleteUserInGroup");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
groupId String The group id
user String The user email to delete

Return type

Object

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

getGroupUsers

ODataResponseListGroupUserAccessRight getGroupUsers(groupId)

Get a group users list

Example

// Import classes:
//import com.microsoft.powerbi.ApiException;
//import com.microsoft.powerbi.api.GroupsApi;


GroupsApi apiInstance = new GroupsApi();
String groupId = "groupId_example"; // String | The group id
try {
    ODataResponseListGroupUserAccessRight result = apiInstance.getGroupUsers(groupId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GroupsApi#getGroupUsers");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
groupId String The group id

Return type

ODataResponseListGroupUserAccessRight

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getGroups

ODataResponseListGroup getGroups()

Returns a list of groups

Example

// Import classes:
//import com.microsoft.powerbi.ApiException;
//import com.microsoft.powerbi.api.GroupsApi;


GroupsApi apiInstance = new GroupsApi();
try {
    ODataResponseListGroup result = apiInstance.getGroups();
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GroupsApi#getGroups");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

ODataResponseListGroup

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json