命名空间:microsoft.graph.managedTenants
重要
Microsoft Graph版本下的 /beta API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
更新 tenantCustomizedInformation 对象 的属性。
权限
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限。
| 权限类型 |
权限(从最低特权到最高特权) |
| 委派(工作或学校帐户) |
ManagedTenants.ReadWrite.All |
| 委派(个人 Microsoft 帐户) |
不支持。 |
| 应用程序 |
不支持。 |
HTTP 请求
PATCH /tenantRelationships/managedTenants/tenantsCustomizedInformation/{tenantCustomizedInformationId}
| 名称 |
说明 |
| Authorization |
Bearer {token}。必需。 |
| Content-Type |
application/json. Required. |
请求正文
在请求正文中,提供 tenantCustomizedInformation 对象的 JSON 表示形式。
下表显示更新 tenantCustomizedInformation 时所需的属性。
响应
如果成功,此方法在响应正文中返回 响应代码和更新的 200 OK tenantCustomizedInformation 对象。
示例
请求
PATCH https://graph.microsoft.com/beta/tenantRelationships/managedTenants/tenantsCustomizedInformation/{tenantCustomizedInformationId}
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.managedTenants.tenantCustomizedInformation",
"tenantId": "String",
"contacts": [
{
"@odata.type": "microsoft.graph.managedTenants.tenantContactInformation",
"name": "String",
"title": "String",
"email": "String",
"phone": "String",
"notes": "String"
}
],
"website": "String"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var tenantCustomizedInformation = new Microsoft.Graph.ManagedTenants.TenantCustomizedInformation
{
TenantId = "String",
Contacts = new List<Microsoft.Graph.ManagedTenants.TenantContactInformation>()
{
new TenantContactInformation
{
Name = "String",
Title = "String",
Email = "String",
Phone = "String",
Notes = "String"
}
},
Website = "String"
};
await graphClient.TenantRelationships.ManagedTenants.TenantsCustomizedInformation["{managedTenants.tenantCustomizedInformation-id}"]
.Request()
.UpdateAsync(tenantCustomizedInformation);
const options = {
authProvider,
};
const client = Client.init(options);
const tenantCustomizedInformation = {
'@odata.type': '#microsoft.graph.managedTenants.tenantCustomizedInformation',
tenantId: 'String',
contacts: [
{
'@odata.type': 'microsoft.graph.managedTenants.tenantContactInformation',
name: 'String',
title: 'String',
email: 'String',
phone: 'String',
notes: 'String'
}
],
website: 'String'
};
await client.api('/tenantRelationships/managedTenants/tenantsCustomizedInformation/{tenantCustomizedInformationId}')
.version('beta')
.update(tenantCustomizedInformation);
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/tenantRelationships/managedTenants/tenantsCustomizedInformation/{tenantCustomizedInformationId}"]]];
[urlRequest setHTTPMethod:@"PATCH"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphManagedTenantsTenantCustomizedInformation *tenantCustomizedInformation = [[MSGraphManagedTenantsTenantCustomizedInformation alloc] init];
[tenantCustomizedInformation setTenantId:@"String"];
NSMutableArray *contactsList = [[NSMutableArray alloc] init];
MSGraphManagedTenantsTenantContactInformation *contacts = [[MSGraphManagedTenantsTenantContactInformation alloc] init];
[contacts setName:@"String"];
[contacts setTitle:@"String"];
[contacts setEmail:@"String"];
[contacts setPhone:@"String"];
[contacts setNotes:@"String"];
[contactsList addObject: contacts];
[tenantCustomizedInformation setContacts:contactsList];
[tenantCustomizedInformation setWebsite:@"String"];
NSError *error;
NSData *tenantCustomizedInformationData = [tenantCustomizedInformation getSerializedDataWithError:&error];
[urlRequest setHTTPBody:tenantCustomizedInformationData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
TenantCustomizedInformation tenantCustomizedInformation = new TenantCustomizedInformation();
tenantCustomizedInformation.tenantId = "String";
LinkedList<TenantContactInformation> contactsList = new LinkedList<TenantContactInformation>();
TenantContactInformation contacts = new TenantContactInformation();
contacts.name = "String";
contacts.title = "String";
contacts.email = "String";
contacts.phone = "String";
contacts.notes = "String";
contactsList.add(contacts);
tenantCustomizedInformation.contacts = contactsList;
tenantCustomizedInformation.website = "String";
graphClient.tenantRelationships().managedTenants().tenantsCustomizedInformation("{tenantCustomizedInformationId}")
.buildRequest()
.patch(tenantCustomizedInformation);
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewTenantCustomizedInformation()
tenantId := "String"
requestBody.SetTenantId(&tenantId)
requestBody.SetContacts( []TenantContactInformation {
msgraphsdk.NewTenantContactInformation(),
name := "String"
SetName(&name)
title := "String"
SetTitle(&title)
email := "String"
SetEmail(&email)
phone := "String"
SetPhone(&phone)
notes := "String"
SetNotes(¬es)
SetAdditionalData(map[string]interface{}{
"@odata.type": "microsoft.graph.managedTenants.tenantContactInformation",
}
}
website := "String"
requestBody.SetWebsite(&website)
requestBody.SetAdditionalData(map[string]interface{}{
"@odata.type": "#microsoft.graph.managedTenants.tenantCustomizedInformation",
}
tenantCustomizedInformationId := "tenantCustomizedInformation-id"
graphClient.TenantRelationships().ManagedTenants().TenantsCustomizedInformationById(&tenantCustomizedInformationId).Patch(requestBody)
响应
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.managedTenants.tenantCustomizedInformation",
"id": "34298981-4fc8-4974-9486-c8909ed1521b",
"tenantId": "34298981-4fc8-4974-9486-c8909ed1521b",
"website": "https://www.fourthcoffee.com",
"contacts": [
{
"name": "Sally",
"email": "sally@fourthcoffee.com",
"phone": "5558009731"
},
{
"name": "Hector",
"email": "hector@fourthcoffee.com",
"phone": "5558009732"
}
]
}