Skip to content

Add itemWithPath to OneDrive items #908

@jasonjoh

Description

@jasonjoh

Is your feature request related to a problem? Please describe the problem.

The OneDrive APIs support getting an item with a path instead of an ID. From https://learn.microsoft.com/en-us/graph/api/driveitem-get?view=graph-rest-1.0&tabs=http:

GET /drives/{drive-id}/root:/{item-path}

Other SDKs implement this as a custom request builder, for example in C#:
https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/609cef23d74a36afc7112d48e766b5d417224515/src/Microsoft.Graph/Extensions/DriveItemRequestBuilderExtensions.cs#L45

This SDK should implement something similar.

Describe the solution you'd like.

const uploadSession = await graphClient.drives
  .byDriveId(myDrive.id)
  .items.byDriveItemId('root')
  .itemWithPath('some/path.txt')
  .createUploadSession
  .post(uploadSessionBody);

Additional context?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions