投稿: 返信post: reply

グループ会話の投稿に返信して、指定されたスレッドに新しい投稿を追加します。要求内で親の会話とスレッドの両方を指定するか、または親の会話を使用せずに親スレッドだけを指定することができます。Reply to a post and add a new post to the specified thread in a group conversation. You can specify both the parent conversation and thread in the request, or, you can specify just the parent thread without the parent conversation.

アクセス許可Permissions

この API を呼び出すには、次のいずれかのアクセス許可が必要です。アクセス許可の選択方法などの詳細については、「アクセス許可」を参照してください。One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

アクセス許可の種類Permission type アクセス許可 (特権の小さいものから大きいものへ)Permissions (from least to most privileged)
委任 (職場または学校のアカウント)Delegated (work or school account) Group.ReadWrite.AllGroup.ReadWrite.All
委任 (個人用 Microsoft アカウント)Delegated (personal Microsoft account) サポートされていません。Not supported.
アプリケーションApplication Group.ReadWrite.AllGroup.ReadWrite.All

HTTP 要求HTTP request

POST /groups/{id}/threads/{id}/posts/{id}/reply
POST /groups/{id}/conversations/{id}/threads/{id}/posts/{id}/reply

要求ヘッダーRequest headers

ヘッダーHeader Value
AuthorizationAuthorization ベアラー {トークン}。必須。Bearer {token}. Required.

要求本文Request body

要求本文で、次のパラメーターを含む JSON オブジェクトを指定します。In the request body, provide a JSON object with the following parameters.

パラメーターParameter Type 説明Description
postpost postpost 返信中の新規の投稿。The new post that is being replied with.

応答Response

成功した場合、このメソッドは 200 OK 応答コードを返します。応答本文には何も返されません。If successful, this method returns 200 OK response code. It does not return anything in the response body.

Example

以下は、この API を呼び出す方法の例です。Here is an example of how to call this API.

要求Request

以下は、要求の例です。Here is an example of the request.

POST https://graph.microsoft.com/v1.0/groups/{id}/threads/{id}/posts/{id}/reply
Content-type: application/json
Content-length: 1131

{
  "post": {
    "body": {
      "contentType": "",
      "content": "content-value"
    },
    "receivedDateTime": "datetime-value",
    "hasAttachments": true,
    "from": {
      "emailAddress": {
        "name": "name-value",
        "address": "address-value"
      }
    },
    "sender": {
      "emailAddress": {
        "name": "name-value",
        "address": "address-value"
      }
    },
    "conversationThreadId": "conversationThreadId-value",
    "newParticipants": [
      {
        "emailAddress": {
          "name": "name-value",
          "address": "address-value"
        }
      }
    ],
    "conversationId": "conversationId-value",
    "createdDateTime": "datetime-value",
    "lastModifiedDateTime": "datetime-value",
    "changeKey": "changeKey-value",
    "categories": [
      "categories-value"
    ],
    "id": "id-value",
    "inReplyTo": {
    },
    "attachments": [
      {
        "lastModifiedDateTime": "datetime-value",
        "name": "name-value",
        "contentType": "contentType-value",
        "size": 99,
        "isInline": true,
        "id": "id-value"
      }
    ]
  }
}
応答Response

以下は、応答の例です。Here is an example of the response.

HTTP/1.1 200 OK

SDK サンプルコードSDK sample code


GraphServiceClient graphClient = new GraphServiceClient( authProvider );

var attachments = new Attachment
{
    LastModifiedDateTime = "datetime-value",
    Name = "name-value",
    ContentType = "contentType-value",
    Size = 99,
    IsInline = true,
    Id = "id-value",
};

var attachmentsList = new List<Attachment>();
attachmentsList.Add( attachments );

var inReplyTo = new Post
{
};

var categoriesList = new List<String>();
categoriesList.Add( "categories-value" );

var emailAddress = new EmailAddress
{
    Name = "name-value",
    Address = "address-value",
};

var newParticipants = new Recipient
{
    EmailAddress = emailAddress,
};

var newParticipantsList = new List<Recipient>();
newParticipantsList.Add( newParticipants );

var emailAddress = new EmailAddress
{
    Name = "name-value",
    Address = "address-value",
};

var sender = new Recipient
{
    EmailAddress = emailAddress,
};

var emailAddress = new EmailAddress
{
    Name = "name-value",
    Address = "address-value",
};

var from = new Recipient
{
    EmailAddress = emailAddress,
};

var body = new ItemBody
{
    ContentType = BodyType.Text,
    Content = "content-value",
};

var post = new Post
{
    Body = body,
    ReceivedDateTime = "datetime-value",
    HasAttachments = true,
    From = from,
    Sender = sender,
    ConversationThreadId = "conversationThreadId-value",
    NewParticipants = newParticipantsList,
    ConversationId = "conversationId-value",
    CreatedDateTime = "datetime-value",
    LastModifiedDateTime = "datetime-value",
    ChangeKey = "changeKey-value",
    Categories = categoriesList,
    Id = "id-value",
    InReplyTo = inReplyTo,
    Attachments = attachmentsList,
};

await graphClient.Groups["{id}"].Threads["{id}"].Posts["{id}"]
    .Reply(post)
    .Request()
    .PostAsync()

SDK をプロジェクトに追加し、 authproviderインスタンスを作成する方法の詳細については、 sdk のドキュメントを参照してください。Read the SDK documentation for details on how to add the SDK to your project and create an authProvider instance.