APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
This update must be a distinct operation. It cannot be combined with updates to other educationUser properties.
For example, updating both relatedContacts and displayName requires two distinct requests.
Response
If successful, this method returns a 200 OK response code and an updated educationUser object in the response body.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new EducationUser
{
RelatedContacts = new List<RelatedContact>
{
new RelatedContact
{
DisplayName = "Father Time",
EmailAddress = "father@time.com",
MobilePhone = "4251231234",
Relationship = ContactRelationship.Guardian,
AccessConsent = true,
},
new RelatedContact
{
DisplayName = "Mother Nature",
EmailAddress = "mother@nature.co.uk",
MobilePhone = "3251231234",
Relationship = ContactRelationship.Parent,
AccessConsent = true,
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Education.Users["{educationUser-id}"].PatchAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc-beta education users patch --education-user-id {educationUser-id} --body '{\
"relatedContacts": [\
{\
"displayName": "Father Time",\
"emailAddress": "father@time.com",\
"mobilePhone": "4251231234",\
"relationship": "guardian",\
"accessConsent": true\
},\
{\
"displayName": "Mother Nature",\
"emailAddress": "mother@nature.co.uk",\
"mobilePhone": "3251231234",\
"relationship": "parent",\
"accessConsent": true\
}\
]\
}\
'
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
EducationUser educationUser = new EducationUser();
LinkedList<RelatedContact> relatedContacts = new LinkedList<RelatedContact>();
RelatedContact relatedContact = new RelatedContact();
relatedContact.setDisplayName("Father Time");
relatedContact.setEmailAddress("father@time.com");
relatedContact.setMobilePhone("4251231234");
relatedContact.setRelationship(ContactRelationship.Guardian);
relatedContact.setAccessConsent(true);
relatedContacts.add(relatedContact);
RelatedContact relatedContact1 = new RelatedContact();
relatedContact1.setDisplayName("Mother Nature");
relatedContact1.setEmailAddress("mother@nature.co.uk");
relatedContact1.setMobilePhone("3251231234");
relatedContact1.setRelationship(ContactRelationship.Parent);
relatedContact1.setAccessConsent(true);
relatedContacts.add(relatedContact1);
educationUser.setRelatedContacts(relatedContacts);
EducationUser result = graphClient.education().users().byEducationUserId("{educationUser-id}").patch(educationUser);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see: https://aka.ms/ContentUserFeedback.