Espace de noms: microsoft.graph
Importante
Les API sous la version /beta dans Microsoft Graph sont susceptibles d’être modifiées. L’utilisation de ces API dans des applications de production n’est pas prise en charge. Pour déterminer si une API est disponible dans v1.0, utilisez le sélecteur Version .
Répondre à un thread dans une conversation de groupe et y ajouter un nouveau billet. Vous pouvez spécifier la conversation parent dans la requête ou spécifier simplement le thread sans la conversation parent.
Cette API est disponible dans les déploiements de cloud national suivants.
| Service global |
Gouvernement des États-Unis L4 |
Us Government L5 (DOD) |
Chine gérée par 21Vianet |
| ✅ |
✅ |
✅ |
✅ |
Autorisations
L’une des autorisations suivantes est nécessaire pour appeler cette API. Pour plus d’informations, notamment sur la façon de choisir les autorisations, voir Autorisations.
| Type d’autorisation |
Autorisations (de celle qui offre le plus de privilèges à celle qui en offre le moins) |
| Déléguée (compte professionnel ou scolaire) |
Group.ReadWrite.All |
| Déléguée (compte Microsoft personnel) |
Non prise en charge. |
| Application |
Non prise en charge. |
Requête HTTP
POST /groups/{id}/threads/{id}/reply
POST /groups/{id}/conversations/{id}/threads/{id}/reply
Corps de la demande
Dans le corps de la demande, indiquez un objet JSON avec les paramètres suivants.
| Paramètre |
Type |
Description |
| publier |
post |
Nouveau billet avec lequel la réponse est envoyée. |
Réponse
Si elle réussit, cette méthode renvoie un code de réponse 202 Accepted. Il ne retourne rien dans le corps de la réponse.
Exemple
Voici comment vous pouvez appeler cette API.
Demande
L’exemple suivant illustre une demande.
POST https://graph.microsoft.com/beta/groups/{id}/threads/{id}/reply
Content-type: application/json
{
"post": {
"body": {
"contentType": "",
"content": "content-value"
}
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Groups.Item.Threads.Item.Reply;
using Microsoft.Graph.Beta.Models;
var requestBody = new ReplyPostRequestBody
{
Post = new Post
{
Body = new ItemBody
{
ContentType = BodyType.Text,
Content = "content-value",
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Groups["{group-id}"].Threads["{conversationThread-id}"].Reply.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphgroups "github.com/microsoftgraph/msgraph-beta-sdk-go/groups"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphgroups.NewReplyPostRequestBody()
post := graphmodels.NewPost()
body := graphmodels.NewItemBody()
contentType := graphmodels.TEXT_BODYTYPE
body.SetContentType(&contentType)
content := "content-value"
body.SetContent(&content)
post.SetBody(body)
requestBody.SetPost(post)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Groups().ByGroupId("group-id").Threads().ByConversationThreadId("conversationThread-id").Reply().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.groups.item.threads.item.reply.ReplyPostRequestBody replyPostRequestBody = new com.microsoft.graph.beta.groups.item.threads.item.reply.ReplyPostRequestBody();
Post post = new Post();
ItemBody body = new ItemBody();
body.setContentType(BodyType.Text);
body.setContent("content-value");
post.setBody(body);
replyPostRequestBody.setPost(post);
graphClient.groups().byGroupId("{group-id}").threads().byConversationThreadId("{conversationThread-id}").reply().post(replyPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const reply = {
post: {
body: {
contentType: '',
content: 'content-value'
}
}
};
await client.api('/groups/{id}/threads/{id}/reply')
.version('beta')
.post(reply);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Groups\Item\Threads\Item\Reply\ReplyPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\Post;
use Microsoft\Graph\Beta\Generated\Models\ItemBody;
use Microsoft\Graph\Beta\Generated\Models\BodyType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ReplyPostRequestBody();
$post = new Post();
$postBody = new ItemBody();
$postBody->setContentType(new BodyType('text'));
$postBody->setContent('content-value');
$post->setBody($postBody);
$requestBody->setPost($post);
$graphServiceClient->groups()->byGroupId('group-id')->threads()->byConversationThreadId('conversationThread-id')->reply()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Groups
$params = @{
post = @{
body = @{
contentType = ""
content = "content-value"
}
}
}
Invoke-MgBetaReplyGroupThread -GroupId $groupId -ConversationThreadId $conversationThreadId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.groups.item.threads.item.reply.reply_post_request_body import ReplyPostRequestBody
from msgraph_beta.generated.models.post import Post
from msgraph_beta.generated.models.item_body import ItemBody
from msgraph_beta.generated.models.body_type import BodyType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ReplyPostRequestBody(
post = Post(
body = ItemBody(
content_type = BodyType.Text,
content = "content-value",
),
),
)
await graph_client.groups.by_group_id('group-id').threads.by_conversation_thread_id('conversationThread-id').reply.post(request_body)
Réponse
L’exemple suivant illustre la réponse.
HTTP/1.1 202 Accepted