Microsoft: Invoke action create Upload Session — me Calendar events Attachments Create Upload Session
Microsoft meCalendar.eventsAttachmentsCreateUploadSession: arguments, response, policy and SDK examples.
← Me calendar operations · Get started
Operation microsoft.me_calendar_events_event_attachments_createuploadsession
Provider route: POST /me/calendar/events/{event-id}/attachments/createUploadSession. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/microsoft with npm, or alter-sdk-microsoft with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { MicrosoftIntegration } from "@alter-ai/microsoft";
async function execute(input: Parameters<MicrosoftIntegration["meCalendar"]["eventsAttachmentsCreateUploadSession"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new MicrosoftIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.meCalendar.eventsAttachmentsCreateUploadSession(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_microsoft import MicrosoftIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = MicrosoftIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.me_calendar.events_attachments_create_upload_session(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.event-id | string | Required within parent | |
body | object | Required within parent | |
body.AttachmentItem | Model | Optional | Expand Invoke action create Upload Session — me Event events Attachments Create Upload Session — request body — body Attachment Item |
Referenced models: Invoke action create Upload Session — me Event events Attachments Create Upload Session — request body — body Attachment Item
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | Model | Alternative | Expand Invoke action create Upload Session — me Event events Attachments Create Upload Session — response body — @odata type, expiration Date Time, next Expected Ranges, upload Url |
$ (anyOf 2) | JSON | Alternative | |
$ (anyOf 2) (anyOf 1) | object | Alternative | |
$ (anyOf 2) (anyOf 2) | null | Alternative |
Schemas
Section titled “Schemas”Invoke action create Upload Session — me Event events Attachments Create Upload Session — response body — @odata type, expiration Date Time, next Expected Ranges, upload Url
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
@odata.type | string | Optional | |
expirationDateTime | JSON | Optional | |
expirationDateTime (anyOf 1) | string | Alternative | The date and time in UTC that the upload session expires. The complete file must be uploaded before this expiration time is reached. Each fragment uploaded during the session extends the expiration time. Format: date-time Pattern: ^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$ |
expirationDateTime (anyOf 2) | null | Alternative | |
nextExpectedRanges | array | Optional | A collection of byte ranges that the server is missing for the file. These ranges are zero indexed and of the format 'start-end' (for example '0-26' to indicate the first 27 bytes of the file). When uploading files as Outlook attachments, instead of a collection of ranges, this property always indicates a single value '{start}', the location in the file where the next upload should begin. |
nextExpectedRanges[] | JSON | Each item | |
nextExpectedRanges[] (anyOf 1) | string | Alternative | |
nextExpectedRanges[] (anyOf 2) | null | Alternative | |
uploadUrl | JSON | Optional | |
uploadUrl (anyOf 1) | string | Alternative | The URL endpoint that accepts PUT requests for byte ranges of the file. |
uploadUrl (anyOf 2) | null | Alternative |
Invoke action create Upload Session — me Event events Attachments Create Upload Session — request body — body Attachment Item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
@odata.type | string | Optional | |
attachmentType | JSON | Optional | The type of attachment. The possible values are: file, item, reference. Required. |
attachmentType (anyOf 1) | string | Alternative | One of: file, item, reference |
attachmentType (anyOf 2) | JSON | Alternative | |
attachmentType (anyOf 2) (anyOf 1) | object | Alternative | |
attachmentType (anyOf 2) (anyOf 2) | null | Alternative | |
contentId | JSON | Optional | |
contentId (anyOf 1) | string | Alternative | The CID or Content-Id of the attachment for referencing for the in-line attachments using the <img src='cid:contentId'> tag in HTML messages. Optional. |
contentId (anyOf 2) | null | Alternative | |
contentType | JSON | Optional | |
contentType (anyOf 1) | string | Alternative | The nature of the data in the attachment. Optional. |
contentType (anyOf 2) | null | Alternative | |
isInline | JSON | Optional | |
isInline (anyOf 1) | boolean | Alternative | true if the attachment is an inline attachment; otherwise, false. Optional. |
isInline (anyOf 2) | null | Alternative | |
name | JSON | Optional | |
name (anyOf 1) | string | Alternative | The display name of the attachment. This can be a descriptive string and doesn't have to be the actual file name. Required. |
name (anyOf 2) | null | Alternative | |
size | JSON | Optional | |
size (anyOf 1) | number | Alternative | The length of the attachment in bytes. Required. Format: int64 |
size (anyOf 2) | null | Alternative |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: microsoft.me_calendar_events_event_attachments_createuploadsession. Catalog operation: me_calendar_events_event_attachments_createuploadsession. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.