命名空间:microsoft.graph
在虚拟事件上创建新的 virtualEventPresenter 对象。
目前,支持以下类型的虚拟事件:
此 API 可用于以下国家级云部署。
全局服务 |
美国政府 L4 |
美国政府 L5 (DOD) |
由世纪互联运营的中国 |
✅ |
❌ |
❌ |
❌ |
权限
为此 API 选择标记为最低特权的权限。
只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。
权限类型 |
最低特权权限 |
更高特权权限 |
委派(工作或学校帐户) |
VirtualEvent.ReadWrite |
不可用。 |
委派(个人 Microsoft 帐户) |
不支持。 |
不支持。 |
应用程序 |
不支持。 |
不支持。 |
HTTP 请求
POST /solutions/virtualEvents/townhalls/{townhallId}/presenters
POST /solutions/virtualEvents/webinars/{webinarId}/presenters
名称 |
说明 |
Authorization |
持有者 {token}。 必填。 详细了解 身份验证和授权。 |
Content-Type |
application/json. 必需。 |
请求正文
在请求正文中,提供 virtualEventPresenter 对象的 JSON 表示形式。
在 virtualEventTownhall 上创建演示者时,可以指定以下属性:
在 virtualEventWebinar 上创建演示者时,可以指定以下属性:
响应
如果成功,此方法在 201 Created
响应正文中返回响应代码和 virtualEventPresenter 对象。
示例
示例 1:在 virtualEventWebinar 上创建租户内演示者
以下示例演示如何在 virtualEventWebinar 上创建一个内部用户作为演示者。
请求
以下示例显示了一个请求。
POST https://graph.microsoft.com/v1.0/solutions/virtualEvents/webinars/6b48b5dd-e3a0-428c-b7ad-90896b87a047@09a21d49-f0f3-4b3f-96b6-f381e9430742/presenters
Content-Type: application/json
{
"identity": {
"@odata.type": "#microsoft.graph.communicationsUserIdentity",
"id": "7b7e1acd-a3e0-4533-8c1d-c1a4ca0b2e2b"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new VirtualEventPresenter
{
Identity = new CommunicationsUserIdentity
{
OdataType = "#microsoft.graph.communicationsUserIdentity",
Id = "7b7e1acd-a3e0-4533-8c1d-c1a4ca0b2e2b",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Solutions.VirtualEvents.Webinars["{virtualEventWebinar-id}"].Presenters.PostAsync(requestBody);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
mgc solutions virtual-events webinars presenters create --virtual-event-webinar-id {virtualEventWebinar-id} --body '{\
"identity": {\
"@odata.type": "#microsoft.graph.communicationsUserIdentity",\
"id": "7b7e1acd-a3e0-4533-8c1d-c1a4ca0b2e2b"\
}\
}\
'
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewVirtualEventPresenter()
identity := graphmodels.NewCommunicationsUserIdentity()
id := "7b7e1acd-a3e0-4533-8c1d-c1a4ca0b2e2b"
identity.SetId(&id)
requestBody.SetIdentity(identity)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
presenters, err := graphClient.Solutions().VirtualEvents().Webinars().ByVirtualEventWebinarId("virtualEventWebinar-id").Presenters().Post(context.Background(), requestBody, nil)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
VirtualEventPresenter virtualEventPresenter = new VirtualEventPresenter();
CommunicationsUserIdentity identity = new CommunicationsUserIdentity();
identity.setOdataType("#microsoft.graph.communicationsUserIdentity");
identity.setId("7b7e1acd-a3e0-4533-8c1d-c1a4ca0b2e2b");
virtualEventPresenter.setIdentity(identity);
VirtualEventPresenter result = graphClient.solutions().virtualEvents().webinars().byVirtualEventWebinarId("{virtualEventWebinar-id}").presenters().post(virtualEventPresenter);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
const virtualEventPresenter = {
identity: {
'@odata.type': '#microsoft.graph.communicationsUserIdentity',
id: '7b7e1acd-a3e0-4533-8c1d-c1a4ca0b2e2b'
}
};
await client.api('/solutions/virtualEvents/webinars/6b48b5dd-e3a0-428c-b7ad-90896b87a047@09a21d49-f0f3-4b3f-96b6-f381e9430742/presenters')
.post(virtualEventPresenter);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\VirtualEventPresenter;
use Microsoft\Graph\Generated\Models\CommunicationsUserIdentity;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new VirtualEventPresenter();
$identity = new CommunicationsUserIdentity();
$identity->setOdataType('#microsoft.graph.communicationsUserIdentity');
$identity->setId('7b7e1acd-a3e0-4533-8c1d-c1a4ca0b2e2b');
$requestBody->setIdentity($identity);
$result = $graphServiceClient->solutions()->virtualEvents()->webinars()->byVirtualEventWebinarId('virtualEventWebinar-id')->presenters()->post($requestBody)->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.Bookings
$params = @{
identity = @{
"@odata.type" = "#microsoft.graph.communicationsUserIdentity"
id = "7b7e1acd-a3e0-4533-8c1d-c1a4ca0b2e2b"
}
}
New-MgVirtualEventWebinarPresenter -VirtualEventWebinarId $virtualEventWebinarId -BodyParameter $params
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.virtual_event_presenter import VirtualEventPresenter
from msgraph.generated.models.communications_user_identity import CommunicationsUserIdentity
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = VirtualEventPresenter(
identity = CommunicationsUserIdentity(
odata_type = "#microsoft.graph.communicationsUserIdentity",
id = "7b7e1acd-a3e0-4533-8c1d-c1a4ca0b2e2b",
),
)
result = await graph_client.solutions.virtual_events.webinars.by_virtual_event_webinar_id('virtualEventWebinar-id').presenters.post(request_body)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 201 Created
Content-Type: application/json
{
"id": "7b7e1acd-a3e0-4533-8c1d-c1a4ca0b2e2b",
"email": "kenneth.brown@contoso.com",
"identity": {
"@odata.type": "#microsoft.graph.communicationsUserIdentity",
"id": "7b7e1acd-a3e0-4533-8c1d-c1a4ca0b2e2b",
"displayName": "Kennth Brown",
"tenantId": "77229959-e479-4a73-b6e0-ddac27be315c"
},
"presenterDetails": null
}
示例 2:在 virtualEventWebinar 上创建租户外演示者
以下示例演示如何在 virtualEventWebinar 上创建来宾用户作为演示者。
请求
以下示例显示了一个请求。
POST https://graph.microsoft.com/v1.0/solutions/virtualEvents/webinars/6b48b5dd-e3a0-428c-b7ad-90896b87a047@09a21d49-f0f3-4b3f-96b6-f381e9430742/presenters
Content-Type: application/json
{
"identity": {
"@odata.type": "#microsoft.graph.communicationsGuestIdentity",
"displayName": "Guest Speaker",
"email": "guest.speaker@fabrikam.com"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new VirtualEventPresenter
{
Identity = new CommunicationsGuestIdentity
{
OdataType = "#microsoft.graph.communicationsGuestIdentity",
DisplayName = "Guest Speaker",
AdditionalData = new Dictionary<string, object>
{
{
"email" , "guest.speaker@fabrikam.com"
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Solutions.VirtualEvents.Webinars["{virtualEventWebinar-id}"].Presenters.PostAsync(requestBody);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
mgc solutions virtual-events webinars presenters create --virtual-event-webinar-id {virtualEventWebinar-id} --body '{\
"identity": {\
"@odata.type": "#microsoft.graph.communicationsGuestIdentity",\
"displayName": "Guest Speaker",\
"email": "guest.speaker@fabrikam.com"\
}\
}\
'
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewVirtualEventPresenter()
identity := graphmodels.NewCommunicationsGuestIdentity()
displayName := "Guest Speaker"
identity.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"email" : "guest.speaker@fabrikam.com",
}
identity.SetAdditionalData(additionalData)
requestBody.SetIdentity(identity)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
presenters, err := graphClient.Solutions().VirtualEvents().Webinars().ByVirtualEventWebinarId("virtualEventWebinar-id").Presenters().Post(context.Background(), requestBody, nil)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
VirtualEventPresenter virtualEventPresenter = new VirtualEventPresenter();
CommunicationsGuestIdentity identity = new CommunicationsGuestIdentity();
identity.setOdataType("#microsoft.graph.communicationsGuestIdentity");
identity.setDisplayName("Guest Speaker");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("email", "guest.speaker@fabrikam.com");
identity.setAdditionalData(additionalData);
virtualEventPresenter.setIdentity(identity);
VirtualEventPresenter result = graphClient.solutions().virtualEvents().webinars().byVirtualEventWebinarId("{virtualEventWebinar-id}").presenters().post(virtualEventPresenter);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
const virtualEventPresenter = {
identity: {
'@odata.type': '#microsoft.graph.communicationsGuestIdentity',
displayName: 'Guest Speaker',
email: 'guest.speaker@fabrikam.com'
}
};
await client.api('/solutions/virtualEvents/webinars/6b48b5dd-e3a0-428c-b7ad-90896b87a047@09a21d49-f0f3-4b3f-96b6-f381e9430742/presenters')
.post(virtualEventPresenter);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\VirtualEventPresenter;
use Microsoft\Graph\Generated\Models\CommunicationsGuestIdentity;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new VirtualEventPresenter();
$identity = new CommunicationsGuestIdentity();
$identity->setOdataType('#microsoft.graph.communicationsGuestIdentity');
$identity->setDisplayName('Guest Speaker');
$additionalData = [
'email' => 'guest.speaker@fabrikam.com',
];
$identity->setAdditionalData($additionalData);
$requestBody->setIdentity($identity);
$result = $graphServiceClient->solutions()->virtualEvents()->webinars()->byVirtualEventWebinarId('virtualEventWebinar-id')->presenters()->post($requestBody)->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.Bookings
$params = @{
identity = @{
"@odata.type" = "#microsoft.graph.communicationsGuestIdentity"
displayName = "Guest Speaker"
email = "guest.speaker@fabrikam.com"
}
}
New-MgVirtualEventWebinarPresenter -VirtualEventWebinarId $virtualEventWebinarId -BodyParameter $params
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.virtual_event_presenter import VirtualEventPresenter
from msgraph.generated.models.communications_guest_identity import CommunicationsGuestIdentity
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = VirtualEventPresenter(
identity = CommunicationsGuestIdentity(
odata_type = "#microsoft.graph.communicationsGuestIdentity",
display_name = "Guest Speaker",
additional_data = {
"email" : "guest.speaker@fabrikam.com",
}
),
)
result = await graph_client.solutions.virtual_events.webinars.by_virtual_event_webinar_id('virtualEventWebinar-id').presenters.post(request_body)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 201 Created
Content-Type: application/json
{
"id": "184975c0-4096-4a02-b251-c48546691c42",
"email": "guest.speaker@fabrikam.com",
"presenterDetails": null,
"identity": {
"@odata.type": "#microsoft.graph.communicationsGuestIdentity",
"id": "184975c0-4096-4a02-b251-c48546691c42",
"displayName": "Guest Speaker",
"email": "guest.speaker@fabrikam.com"
}
}
示例 3:在 virtualEventTownhall 上创建租户内演示者
以下示例演示如何在 virtualEventTownhall 上创建一个内部用户作为演示者。
请求
以下示例显示了一个请求。
POST https://graph.microsoft.com/v1.0/solutions/virtualEvents/townhalls/502dadea-b5d8-44aa-a851-a0ac496a36bf@09a21d49-f0f3-4b3f-96b6-f381e9430742/presenters
Content-Type: application/json
{
"identity": {
"@odata.type": "#microsoft.graph.communicationsUserIdentity",
"id": "7b7e1acd-a3e0-4533-8c1d-c1a4ca0b2e2b"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new VirtualEventPresenter
{
Identity = new CommunicationsUserIdentity
{
OdataType = "#microsoft.graph.communicationsUserIdentity",
Id = "7b7e1acd-a3e0-4533-8c1d-c1a4ca0b2e2b",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Solutions.VirtualEvents.Townhalls["{virtualEventTownhall-id}"].Presenters.PostAsync(requestBody);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
mgc solutions virtual-events townhalls presenters create --virtual-event-townhall-id {virtualEventTownhall-id} --body '{\
"identity": {\
"@odata.type": "#microsoft.graph.communicationsUserIdentity",\
"id": "7b7e1acd-a3e0-4533-8c1d-c1a4ca0b2e2b"\
}\
}\
'
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewVirtualEventPresenter()
identity := graphmodels.NewCommunicationsUserIdentity()
id := "7b7e1acd-a3e0-4533-8c1d-c1a4ca0b2e2b"
identity.SetId(&id)
requestBody.SetIdentity(identity)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
presenters, err := graphClient.Solutions().VirtualEvents().Townhalls().ByVirtualEventTownhallId("virtualEventTownhall-id").Presenters().Post(context.Background(), requestBody, nil)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
VirtualEventPresenter virtualEventPresenter = new VirtualEventPresenter();
CommunicationsUserIdentity identity = new CommunicationsUserIdentity();
identity.setOdataType("#microsoft.graph.communicationsUserIdentity");
identity.setId("7b7e1acd-a3e0-4533-8c1d-c1a4ca0b2e2b");
virtualEventPresenter.setIdentity(identity);
VirtualEventPresenter result = graphClient.solutions().virtualEvents().townhalls().byVirtualEventTownhallId("{virtualEventTownhall-id}").presenters().post(virtualEventPresenter);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
const virtualEventPresenter = {
identity: {
'@odata.type': '#microsoft.graph.communicationsUserIdentity',
id: '7b7e1acd-a3e0-4533-8c1d-c1a4ca0b2e2b'
}
};
await client.api('/solutions/virtualEvents/townhalls/502dadea-b5d8-44aa-a851-a0ac496a36bf@09a21d49-f0f3-4b3f-96b6-f381e9430742/presenters')
.post(virtualEventPresenter);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\VirtualEventPresenter;
use Microsoft\Graph\Generated\Models\CommunicationsUserIdentity;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new VirtualEventPresenter();
$identity = new CommunicationsUserIdentity();
$identity->setOdataType('#microsoft.graph.communicationsUserIdentity');
$identity->setId('7b7e1acd-a3e0-4533-8c1d-c1a4ca0b2e2b');
$requestBody->setIdentity($identity);
$result = $graphServiceClient->solutions()->virtualEvents()->townhalls()->byVirtualEventTownhallId('virtualEventTownhall-id')->presenters()->post($requestBody)->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.Bookings
$params = @{
identity = @{
"@odata.type" = "#microsoft.graph.communicationsUserIdentity"
id = "7b7e1acd-a3e0-4533-8c1d-c1a4ca0b2e2b"
}
}
New-MgVirtualEventTownhallPresenter -VirtualEventTownhallId $virtualEventTownhallId -BodyParameter $params
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.virtual_event_presenter import VirtualEventPresenter
from msgraph.generated.models.communications_user_identity import CommunicationsUserIdentity
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = VirtualEventPresenter(
identity = CommunicationsUserIdentity(
odata_type = "#microsoft.graph.communicationsUserIdentity",
id = "7b7e1acd-a3e0-4533-8c1d-c1a4ca0b2e2b",
),
)
result = await graph_client.solutions.virtual_events.townhalls.by_virtual_event_townhall_id('virtualEventTownhall-id').presenters.post(request_body)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 201 Created
Content-Type: application/json
{
"id": "7b7e1acd-a3e0-4533-8c1d-c1a4ca0b2e2b",
"email": "kenneth.brown@contoso.com",
"identity": {
"@odata.type": "#microsoft.graph.communicationsUserIdentity",
"id": "7b7e1acd-a3e0-4533-8c1d-c1a4ca0b2e2b",
"displayName": "Kennth Brown",
"tenantId": "77229959-e479-4a73-b6e0-ddac27be315c"
},
"presenterDetails": null
}
示例 4:在 virtualEventTownhall 上创建租户外演示者
以下示例演示如何在 virtualEventTownhall 上创建来宾用户作为演示者。
请求
以下示例显示了一个请求。
POST https://graph.microsoft.com/v1.0/solutions/virtualEvents/townhalls/502dadea-b5d8-44aa-a851-a0ac496a36bf@09a21d49-f0f3-4b3f-96b6-f381e9430742/presenters
Content-Type: application/json
{
"identity": {
"@odata.type": "#microsoft.graph.communicationsGuestIdentity",
"displayName": "Guest Speaker",
"email": "guest.speaker@fabrikam.com"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new VirtualEventPresenter
{
Identity = new CommunicationsGuestIdentity
{
OdataType = "#microsoft.graph.communicationsGuestIdentity",
DisplayName = "Guest Speaker",
AdditionalData = new Dictionary<string, object>
{
{
"email" , "guest.speaker@fabrikam.com"
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Solutions.VirtualEvents.Townhalls["{virtualEventTownhall-id}"].Presenters.PostAsync(requestBody);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
mgc solutions virtual-events townhalls presenters create --virtual-event-townhall-id {virtualEventTownhall-id} --body '{\
"identity": {\
"@odata.type": "#microsoft.graph.communicationsGuestIdentity",\
"displayName": "Guest Speaker",\
"email": "guest.speaker@fabrikam.com"\
}\
}\
'
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewVirtualEventPresenter()
identity := graphmodels.NewCommunicationsGuestIdentity()
displayName := "Guest Speaker"
identity.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"email" : "guest.speaker@fabrikam.com",
}
identity.SetAdditionalData(additionalData)
requestBody.SetIdentity(identity)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
presenters, err := graphClient.Solutions().VirtualEvents().Townhalls().ByVirtualEventTownhallId("virtualEventTownhall-id").Presenters().Post(context.Background(), requestBody, nil)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
VirtualEventPresenter virtualEventPresenter = new VirtualEventPresenter();
CommunicationsGuestIdentity identity = new CommunicationsGuestIdentity();
identity.setOdataType("#microsoft.graph.communicationsGuestIdentity");
identity.setDisplayName("Guest Speaker");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("email", "guest.speaker@fabrikam.com");
identity.setAdditionalData(additionalData);
virtualEventPresenter.setIdentity(identity);
VirtualEventPresenter result = graphClient.solutions().virtualEvents().townhalls().byVirtualEventTownhallId("{virtualEventTownhall-id}").presenters().post(virtualEventPresenter);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
const virtualEventPresenter = {
identity: {
'@odata.type': '#microsoft.graph.communicationsGuestIdentity',
displayName: 'Guest Speaker',
email: 'guest.speaker@fabrikam.com'
}
};
await client.api('/solutions/virtualEvents/townhalls/502dadea-b5d8-44aa-a851-a0ac496a36bf@09a21d49-f0f3-4b3f-96b6-f381e9430742/presenters')
.post(virtualEventPresenter);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\VirtualEventPresenter;
use Microsoft\Graph\Generated\Models\CommunicationsGuestIdentity;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new VirtualEventPresenter();
$identity = new CommunicationsGuestIdentity();
$identity->setOdataType('#microsoft.graph.communicationsGuestIdentity');
$identity->setDisplayName('Guest Speaker');
$additionalData = [
'email' => 'guest.speaker@fabrikam.com',
];
$identity->setAdditionalData($additionalData);
$requestBody->setIdentity($identity);
$result = $graphServiceClient->solutions()->virtualEvents()->townhalls()->byVirtualEventTownhallId('virtualEventTownhall-id')->presenters()->post($requestBody)->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.Bookings
$params = @{
identity = @{
"@odata.type" = "#microsoft.graph.communicationsGuestIdentity"
displayName = "Guest Speaker"
email = "guest.speaker@fabrikam.com"
}
}
New-MgVirtualEventTownhallPresenter -VirtualEventTownhallId $virtualEventTownhallId -BodyParameter $params
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.virtual_event_presenter import VirtualEventPresenter
from msgraph.generated.models.communications_guest_identity import CommunicationsGuestIdentity
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = VirtualEventPresenter(
identity = CommunicationsGuestIdentity(
odata_type = "#microsoft.graph.communicationsGuestIdentity",
display_name = "Guest Speaker",
additional_data = {
"email" : "guest.speaker@fabrikam.com",
}
),
)
result = await graph_client.solutions.virtual_events.townhalls.by_virtual_event_townhall_id('virtualEventTownhall-id').presenters.post(request_body)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 201 Created
Content-Type: application/json
{
"id": "184975c0-4096-4a02-b251-c48546691c42",
"email": "guest.speaker@fabrikam.com",
"presenterDetails": null,
"identity": {
"@odata.type": "#microsoft.graph.communicationsGuestIdentity",
"id": "184975c0-4096-4a02-b251-c48546691c42",
"displayName": "Guest Speaker",
"email": "guest.speaker@fabrikam.com"
}
}