POST https://graph.microsoft.com/v1.0/communications/calls/{id}/changeScreenSharingRole
Content-Type: application/json
Content-Length: 24
{
"role": "viewer"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Communications.Calls.Item.ChangeScreenSharingRole;
using Microsoft.Graph.Models;
var requestBody = new ChangeScreenSharingRolePostRequestBody
{
Role = ScreenSharingRole.Viewer,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Communications.Calls["{call-id}"].ChangeScreenSharingRole.PostAsync(requestBody);
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc communications calls change-screen-sharing-role post --call-id {call-id} --body '{\
"role": "viewer"\
}\
'
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.communications.calls.item.changescreensharingrole.ChangeScreenSharingRolePostRequestBody changeScreenSharingRolePostRequestBody = new com.microsoft.graph.communications.calls.item.changescreensharingrole.ChangeScreenSharingRolePostRequestBody();
changeScreenSharingRolePostRequestBody.setRole(ScreenSharingRole.Viewer);
graphClient.communications().calls().byCallId("{call-id}").changeScreenSharingRole().post(changeScreenSharingRolePostRequestBody);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\ChangeScreenSharingRolePostRequestBody;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ChangeScreenSharingRolePostRequestBody();
$requestBody->setRole(new ScreenSharingRole('viewer'));
$graphServiceClient->communications()->calls()->byCallId('call-id')->changeScreenSharingRole()->post($requestBody)->wait();