List administrativeUnit an educationSchool
-
Article
-
- 2 minutes to read
-
Namespace: microsoft.graph
Get a list of administrativeUnits associated with an educationSchool object.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Permission type |
Permissions (from least to most privileged) |
Delegated (work or school account) |
EduRoster.ReadBasic |
Delegated (personal Microsoft account) |
Not supported. |
Application |
EduRoster.Read.All, EduRoster.ReadWrite.All |
HTTP request
GET /education/schools/{educationSchoolId}/administrativeUnit
Optional query parameters
This method supports some of the OData query parameters to help customize the response. For general information, see OData query parameters.
Name |
Description |
Authorization |
Bearer {token}. Required. |
Request body
Do not supply a request body for this method.
Response
If successful, this method returns a 200 OK
response code and a collection of administrativeUnit objects in the response body.
Examples
Request
GET https://graph.microsoft.com/v1.0/education/classes/{educationClassId}/members/{educationUserId}/schools/{educationSchoolId}/administrativeUnit
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var administrativeUnit = await graphClient.Education.Classes["{educationClass-id}"].Members["{educationUser-id}"].Schools["{educationSchool-id}"].AdministrativeUnit
.Request()
.GetAsync();
Read the SDK documentation for details on how to add the SDK to your project and create an authProvider instance.
const options = {
authProvider,
};
const client = Client.init(options);
let administrativeUnit = await client.api('/education/classes/{educationClassId}/members/{educationUserId}/schools/{educationSchoolId}/administrativeUnit')
.get();
Read the SDK documentation for details on how to add the SDK to your project and create an authProvider instance.
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/education/classes/{educationClassId}/members/{educationUserId}/schools/{educationSchoolId}/administrativeUnit"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
MSGraphAdministrativeUnit *administrativeUnit = [[MSGraphAdministrativeUnit alloc] initWithData:data error:&nserror];
}];
[meDataTask execute];
Read the SDK documentation for details on how to add the SDK to your project and create an authProvider instance.
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
AdministrativeUnit administrativeUnit = graphClient.education().classes("{educationClassId}").members("{educationUserId}").schools("{educationSchoolId}").administrativeUnit()
.buildRequest()
.get();
Read the SDK documentation for details on how to add the SDK to your project and create an authProvider instance.
Response
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"@odata.type": "#microsoft.graph.administrativeUnit",
"id": "03e281d6-81d6-03e2-d681-e203d681e203",
"deletedDateTime": "String (timestamp)",
"displayName": "String",
"description": "String",
"visibility": "String"
}
]
}