-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get drive item by path #2213
Comments
Could the relative path contains _ ? I actually try |
@Ndiritu Could you give some suggestions? |
Sorry for the delay @susanYYT. Yes, based on the guidance here, underscores are allowed. I'm wondering if your path is correct, is the You can test your request path using https://developer.microsoft.com/en-us/graph/graph-explorer to double-check. If you still have trouble, you can pass a custom URL using graphClient.drives().byDriveId("").items().byDriveItemId("").withUrl(
"https://graph.microsoft.com/v1.0/..."
).get(); |
Dear @Ndiritu, Thanks for your reply. Maybe I have some misunderstanding about the The site url is: I tried the graph explorer, I want to consent to permissions but it shows "Retry again". Any suggestions? |
Since I've found the drive AdapterOffice365, I actually need to use |
Glad you were able to resolve this @susanYYT . My apologies for the delayed response. |
Hi,
I'm using Graph v6, and I want to get DriveItem by path.
In v5, I use:
DriveItem item = graphClient.sites(site.id).drives(d.id).root().itemWithPath(itemPath).buildRequest().get();
Now I use
DriveItem item = graphClient.drives().byDriveId(d.getId()).items().byDriveItemId(itemPath).get();
But I received error:
com.microsoft.graph.models.odataerrors.ODataError: Item not found
Does the input itemPath has something special in format?
For example, if my siteUrl is
myshare.sharepoint.com/sites/test1
, then if I get site by path, I can usemyshare.sharepoint.com:/sites/test1:
as input. While for drive item, the sheet relative path is/test1/AdapterOffice365/DPtest.xls/int
. Could you please give me an example?Best regards,
Susan
The text was updated successfully, but these errors were encountered: