How can i get a Sharepoint Folder / document library Id by path?

%3CLINGO-SUB%20id%3D%22lingo-sub-3065286%22%20slang%3D%22en-US%22%3EHow%20can%20i%20get%20a%20Sharepoint%20Folder%20%2F%20document%20library%20Id%20by%20path%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3065286%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20getting%20sharepoint%20folders%20by%20using%20the%20graph%20api%20as%20follows%3C%2FP%3E%3CP%3EThe%20structure%20is%20as%20follows%3A%3C%2FP%3E%3CP%3ETestTeam%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20TestChannel1%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BTestChannelFolder1%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20TestFile1.xlxs%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BTestChannel2%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BTestChannelFolder2%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BTestFile2.xlxs%3C%2FP%3E%3CP%3E%3CBR%20%2F%3ESo%20the%20Team%20is%20TestTeam%20and%20the%20channels%20are%20TestChannel1%2C%20TestChannel2%20and%20in%20each%20channel%20there%20are%20folders%20and%20in%20the%20folders%20there%20are%20files.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EFirst%20I%20get%20the%20Teams%3A%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fme%2Fjoinedteams%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fme%2Fjoinedteams%3C%2FA%3E%3C%2FP%3E%3CP%3EThis%20give%20me%20back%20Json%20data%20with%20id%2C%20displayname%20etc.%3C%2FP%3E%3CP%3EI%20the%20call%20%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fgroups%2F%7Bfolder-id%7D%2Fdrive%2Fitems%2Froot%2Fchildren%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fgroups%2F%7Bfolder-id%7D%2Fdrive%2Fitems%2Froot%2Fchildren%2F%3C%2FA%3E%20This%20gives%20back%20Json%20with%20files%20and%20folders.%3C%2FP%3E%3CP%3EIs%20there%20a%20graph%20api%20call%20that%20can%20directly%20give%20me%20back%20the%20id%20by%20using%20the%20path%20%2C%20instead%20of%20the%20Id%20%3F%3CBR%20%2F%3ESo%20if%20I%20select%20TestTeam-%26gt%3BTestChannel-%26gt%3BTestChannelFolder1%20i%20can%20use%20the%20path%20to%20get%20back%20the%20id%20of%20the%20folder%20so%20i%20can%20get%20the%20contents%20%3F%3C%2FP%3E%3CP%3Eie%20can%20i%20access%20the%20contents%20and%20details%20of%20this%20folder%20by%20using%20something%20like%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fgroups%2FTestTeam%2FTestChannel%2FTestChannelFolder1%2Fdrive%2Fitems%2Froot%2Fchildren%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fgroups%2FTestTeam%2FTestChannel%2FTestChannelFolder1%2Fdrive%2Fitems%2Froot%2Fchildren%2F%3C%2FA%3E%3C%2FP%3E%3CP%3Esimilar%20to%20what%20onedrive%20offers%2C%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fme%2Fdrive%2Froot%3A%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fme%2Fdrive%2Froot%3A%2F%3C%2FA%3E%22%20%2B%20path%20%2B%20%22%2F%22%20%5C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

I am getting sharepoint folders by using the graph api as follows

The structure is as follows:

TestTeam
        TestChannel1
             TestChannelFolder1
                  TestFile1.xlxs
       TestChannel2
             TestChannelFolder2
                 TestFile2.xlxs


So the Team is TestTeam and the channels are TestChannel1, TestChannel2 and in each channel there are folders and in the folders there are files.


First I get the Teams:
https://graph.microsoft.com/v1.0/me/joinedteams

This give me back Json data with id, displayname etc.

I the call https://graph.microsoft.com/v1.0/groups/{folder-id}/drive/items/root/children/ This gives back Json with files and folders.

Is there a graph api call that can directly give me back the id by using the path , instead of the Id ?
So if I select TestTeam->TestChannel->TestChannelFolder1 i can use the path to get back the id of the folder so i can get the contents ?

ie can i access the contents and details of this folder by using something like

https://graph.microsoft.com/v1.0/groups/TestTeam/TestChannel/TestChannelFolder1/drive/items/root/chi...

similar to what onedrive offers,

https://graph.microsoft.com/v1.0/me/drive/root:/" + path + "/" \

 

0 Replies