MailAttachmentUploadLarge
Summary
Creates an upload session for large attachments; your client uploads file chunks directly to the provided URL.
Graph Endpoint
POST /me/messages/{messageId}/attachments/createUploadSession
Parameters
Required
messageId: string
— Alias:id
One of:
attachmentIds: number[]
— Up to 10 repository attachment IDs; backend uploads the files completely.name: string
— When requesting an upload session (legacy/external upload)
Recommended (when requesting an upload session)
size: number
Optional
contentType: string
— Defaultapplication/octet-stream
Usage (app.businessFunction)
Using repository attachments (recommended)
app.businessFunction({
functionName: 'MicrosoftGraph',
methodName: 'Mail',
operation: 'AttachmentUploadLarge',
parameters: {
messageId: 'AAMkAGI2N...',
attachmentIds: [2042] // up to 10
}
})
Requesting an upload session (external upload)
app.businessFunction({
functionName: 'MicrosoftGraph',
methodName: 'Mail',
operation: 'AttachmentUploadLarge',
parameters: {
messageId: 'AAMkAGI2N...',
name: 'video.mp4',
size: 104857600,
contentType: 'video/mp4'
}
})
Response
// When using attachmentIds
{ "ok": true, "attachments": [ { "id": "...", "name": "video.mp4", "size": 104857600, "contentType": "video/mp4" } ] }
// When requesting an upload session
{ "uploadUrl": "https://...", "expirationDateTime": "2024-09-24T10:00:00Z", "nextExpectedRanges": ["0-"] }
Notes
Backend handles upload sessions and chunked PUTs for
attachmentIds
. Limit: max 10 attachments per call.If you request an upload session, upload file chunks to
uploadUrl
using HTTPPUT
with byte ranges as described in Microsoft Graph documentation.
See also
MailSend — send a new message with
attachmentIds
in one callMailReply — reply and attach repository files
MailReplyAll — reply-all with attachments
MailForward — forward with attachments
Last updated
Was this helpful?