message: copymessage: copy

将邮件复制到文件夹。Copy a message to a folder.

权限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) Mail.ReadWriteMail.ReadWrite
委派(个人 Microsoft 帐户)Delegated (personal Microsoft account) Mail.ReadWriteMail.ReadWrite
应用程序Application Mail.ReadWriteMail.ReadWrite

HTTP 请求HTTP request

POST /me/messages/{id}/copy
POST /users/{id | userPrincipalName}/messages/{id}/copy
POST /me/mailFolders/{id}/messages/{id}/copy
POST /users/{id | userPrincipalName}/mailFolders/{id}/messages/{id}/copy

请求标头Request headers

标头Header Value
授权Authorization Bearer {token}. 必需。Required.
Content-TypeContent-Type application/json. 必需。Required.

请求正文Request body

在请求正文中,提供具有以下参数的 JSON 对象。In the request body, provide a JSON object with the following parameters.

参数Parameter 类型Type 说明Description
destinationIddestinationId StringString 目标文件夹 ID 或已知文件夹名称。The destination folder ID, or a well-known folder name. 有关受支持的已知文件夹名称的列表,请参阅 mailFolder 资源类型For a list of supported well-known folder names, see mailFolder resource type.

响应Response

如果成功,此方法在响应正文中返回 201 Created 响应代码和 message 资源。If successful, this method returns 201 Created response code and a message resource 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/me/messages/{id}/copy
Content-type: application/json
Content-length: 44

{
  "destinationId": "destinationId-value"
}
响应Response

下面是一个响应示例。Here is an example of the response.

注意: 为了提高可读性,可能缩短了此处显示的响应对象。Note: The response object shown here might be shortened for readability. 所有属性都将通过实际调用返回。All the properties will be returned from an actual call.

HTTP/1.1 200 OK
Content-type: application/json
Content-length: 248

{
  "receivedDateTime": "datetime-value",
  "sentDateTime": "datetime-value",
  "hasAttachments": true,
  "subject": "subject-value",
  "body": {
    "contentType": "",
    "content": "content-value"
  },
  "bodyPreview": "bodyPreview-value"
}