名前空間: microsoft.graph
重要
Microsoft Graph の /beta
バージョンの API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 v1.0 で API を使用できるかどうかを確認するには、Version セレクターを使用します。
受信者に投稿を転送します。 要求内で親の会話とスレッドの両方を指定するか、または親の会話を使用せずに親スレッドだけを指定することができます。
この API は、次の国内クラウド展開で使用できます。
グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
✅ |
✅ |
✅ |
✅ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「 アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、 アクセス許可のリファレンスを参照してください。
アクセス許可の種類 |
最小特権アクセス許可 |
特権の高いアクセス許可 |
委任 (職場または学校のアカウント) |
Group-Conversation.ReadWrite.All |
Group.ReadWrite.All |
委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
アプリケーション |
Group-Conversation.ReadWrite.All |
Group.ReadWrite.All |
HTTP 要求
POST /groups/{id}/threads/{id}/posts/{id}/forward
POST /groups/{id}/conversations/{id}/threads/{id}/posts/{id}/forward
ヘッダー |
値 |
Authorization |
ベアラー {token}。 必須です。
認証と承認の詳細については、こちらをご覧ください。 |
要求本文
要求本文で、次のパラメーターを含む JSON オブジェクトを指定します。
パラメーター |
型 |
説明 |
comment |
String |
投稿と共に転送されるオプションのコメント。 |
toRecipients |
recipient collection |
スレッドの転送先となる受信者。 |
応答
成功した場合、このメソッドは 200 OK
応答コードを返します。 応答本文では何も返されません。
例
以下は、この API を呼び出す方法の例です。
要求
次の例は要求を示しています。
POST https://graph.microsoft.com/beta/groups/{id}/threads/{id}/posts/{id}/forward
Content-type: application/json
{
"comment": "comment-value",
"toRecipients": [
{
"emailAddress": {
"name": "name-value",
"address": "address-value"
}
}
]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Groups.Item.Threads.Item.Posts.Item.Forward;
using Microsoft.Graph.Beta.Models;
var requestBody = new ForwardPostRequestBody
{
Comment = "comment-value",
ToRecipients = new List<Recipient>
{
new Recipient
{
EmailAddress = new EmailAddress
{
Name = "name-value",
Address = "address-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}"].Posts["{post-id}"].Forward.PostAsync(requestBody);
mgc-beta groups threads posts forward post --group-id {group-id} --conversation-thread-id {conversationThread-id} --post-id {post-id} --body '{\
"comment": "comment-value",\
"toRecipients": [\
{\
"emailAddress": {\
"name": "name-value",\
"address": "address-value"\
}\
}\
]\
}\
'
// 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.NewForwardPostRequestBody()
comment := "comment-value"
requestBody.SetComment(&comment)
recipient := graphmodels.NewRecipient()
emailAddress := graphmodels.NewEmailAddress()
name := "name-value"
emailAddress.SetName(&name)
address := "address-value"
emailAddress.SetAddress(&address)
recipient.SetEmailAddress(emailAddress)
toRecipients := []graphmodels.Recipientable {
recipient,
}
requestBody.SetToRecipients(toRecipients)
// 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").Posts().ByPostId("post-id").Forward().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.posts.item.forward.ForwardPostRequestBody forwardPostRequestBody = new com.microsoft.graph.beta.groups.item.threads.item.posts.item.forward.ForwardPostRequestBody();
forwardPostRequestBody.setComment("comment-value");
LinkedList<Recipient> toRecipients = new LinkedList<Recipient>();
Recipient recipient = new Recipient();
EmailAddress emailAddress = new EmailAddress();
emailAddress.setName("name-value");
emailAddress.setAddress("address-value");
recipient.setEmailAddress(emailAddress);
toRecipients.add(recipient);
forwardPostRequestBody.setToRecipients(toRecipients);
graphClient.groups().byGroupId("{group-id}").threads().byConversationThreadId("{conversationThread-id}").posts().byPostId("{post-id}").forward().post(forwardPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const forward = {
comment: 'comment-value',
toRecipients: [
{
emailAddress: {
name: 'name-value',
address: 'address-value'
}
}
]
};
await client.api('/groups/{id}/threads/{id}/posts/{id}/forward')
.version('beta')
.post(forward);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Groups\Item\Threads\Item\Posts\Item\Forward\ForwardPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\Recipient;
use Microsoft\Graph\Beta\Generated\Models\EmailAddress;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ForwardPostRequestBody();
$requestBody->setComment('comment-value');
$toRecipientsRecipient1 = new Recipient();
$toRecipientsRecipient1EmailAddress = new EmailAddress();
$toRecipientsRecipient1EmailAddress->setName('name-value');
$toRecipientsRecipient1EmailAddress->setAddress('address-value');
$toRecipientsRecipient1->setEmailAddress($toRecipientsRecipient1EmailAddress);
$toRecipientsArray []= $toRecipientsRecipient1;
$requestBody->setToRecipients($toRecipientsArray);
$graphServiceClient->groups()->byGroupId('group-id')->threads()->byConversationThreadId('conversationThread-id')->posts()->byPostId('post-id')->forward()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Groups
$params = @{
comment = "comment-value"
toRecipients = @(
@{
emailAddress = @{
name = "name-value"
address = "address-value"
}
}
)
}
Invoke-MgBetaForwardGroupThreadPost -GroupId $groupId -ConversationThreadId $conversationThreadId -PostId $postId -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.posts.item.forward.forward_post_request_body import ForwardPostRequestBody
from msgraph_beta.generated.models.recipient import Recipient
from msgraph_beta.generated.models.email_address import EmailAddress
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ForwardPostRequestBody(
comment = "comment-value",
to_recipients = [
Recipient(
email_address = EmailAddress(
name = "name-value",
address = "address-value",
),
),
],
)
await graph_client.groups.by_group_id('group-id').threads.by_conversation_thread_id('conversationThread-id').posts.by_post_id('post-id').forward.post(request_body)
応答
次の例は応答を示しています。
HTTP/1.1 200 OK