Elija el permiso o los permisos marcados como con privilegios mínimos para esta API. Use un permiso o permisos con privilegios superiores solo si la aplicación lo requiere. Para obtener más información sobre los permisos delegados y de aplicación, consulte Tipos de permisos. Para obtener más información sobre estos permisos, consulte la referencia de permisos.
Tipo de permiso
Permisos con privilegios mínimos
Permisos con privilegios más altos
Delegado (cuenta profesional o educativa)
No admitida.
No admitida.
Delegado (cuenta personal de Microsoft)
No admitida.
No admitida.
Aplicación
Calls.Initiate.All
Calls.AccessMedia.All
Nota: Los permisos se comprueban cuando se crea la llamada; no se realiza ninguna comprobación de permisos adicional al llamar a esta API. Calls.AccessMedia.All solo es necesario para las llamadas que usan medios hospedados por la aplicación.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Communications.Calls.Item.PlayPrompt;
using Microsoft.Graph.Models;
var requestBody = new PlayPromptPostRequestBody
{
ClientContext = "d45324c1-fcb5-430a-902c-f20af696537c",
Prompts = new List<Prompt>
{
new MediaPrompt
{
OdataType = "#microsoft.graph.mediaPrompt",
MediaInfo = new MediaInfo
{
OdataType = "#microsoft.graph.mediaInfo",
Uri = "https://cdn.contoso.com/beep.wav",
ResourceId = "1D6DE2D4-CD51-4309-8DAA-70768651088E",
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Communications.Calls["{call-id}"].PlayPrompt.PostAsync(requestBody);
// 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.playprompt.PlayPromptPostRequestBody playPromptPostRequestBody = new com.microsoft.graph.communications.calls.item.playprompt.PlayPromptPostRequestBody();
playPromptPostRequestBody.setClientContext("d45324c1-fcb5-430a-902c-f20af696537c");
LinkedList<Prompt> prompts = new LinkedList<Prompt>();
MediaPrompt prompt = new MediaPrompt();
prompt.setOdataType("#microsoft.graph.mediaPrompt");
MediaInfo mediaInfo = new MediaInfo();
mediaInfo.setOdataType("#microsoft.graph.mediaInfo");
mediaInfo.setUri("https://cdn.contoso.com/beep.wav");
mediaInfo.setResourceId("1D6DE2D4-CD51-4309-8DAA-70768651088E");
prompt.setMediaInfo(mediaInfo);
prompts.add(prompt);
playPromptPostRequestBody.setPrompts(prompts);
var result = graphClient.communications().calls().byCallId("{call-id}").playPrompt().post(playPromptPostRequestBody);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Communications\Calls\Item\PlayPrompt\PlayPromptPostRequestBody;
use Microsoft\Graph\Generated\Models\Prompt;
use Microsoft\Graph\Generated\Models\MediaPrompt;
use Microsoft\Graph\Generated\Models\MediaInfo;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new PlayPromptPostRequestBody();
$requestBody->setClientContext('d45324c1-fcb5-430a-902c-f20af696537c');
$promptsPrompt1 = new MediaPrompt();
$promptsPrompt1->setOdataType('#microsoft.graph.mediaPrompt');
$promptsPrompt1MediaInfo = new MediaInfo();
$promptsPrompt1MediaInfo->setOdataType('#microsoft.graph.mediaInfo');
$promptsPrompt1MediaInfo->setUri('https://cdn.contoso.com/beep.wav');
$promptsPrompt1MediaInfo->setResourceId('1D6DE2D4-CD51-4309-8DAA-70768651088E');
$promptsPrompt1->setMediaInfo($promptsPrompt1MediaInfo);
$promptsArray []= $promptsPrompt1;
$requestBody->setPrompts($promptsArray);
$result = $graphServiceClient->communications()->calls()->byCallId('call-id')->playPrompt()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.communications.calls.item.play_prompt.play_prompt_post_request_body import PlayPromptPostRequestBody
from msgraph.generated.models.prompt import Prompt
from msgraph.generated.models.media_prompt import MediaPrompt
from msgraph.generated.models.media_info import MediaInfo
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = PlayPromptPostRequestBody(
client_context = "d45324c1-fcb5-430a-902c-f20af696537c",
prompts = [
MediaPrompt(
odata_type = "#microsoft.graph.mediaPrompt",
media_info = MediaInfo(
odata_type = "#microsoft.graph.mediaInfo",
uri = "https://cdn.contoso.com/beep.wav",
resource_id = "1D6DE2D4-CD51-4309-8DAA-70768651088E",
),
),
],
)
result = await graph_client.communications.calls.by_call_id('call-id').play_prompt.post(request_body)