How to get the file link from a SharePoint/OneDrive Sync location - sharepoint

I am currently using Registry Editor to obtain the cloud OneDrive URL of a local OneDrive folder, through:
HKEY_CURRENT_USER\SOFTWARE\SyncEngines\Providers\OneDrive\ -> UrlNameSpace.
However, for shared folders I cannot seem to obtain the correct path based on the UrlNameSpace property. For example the following below returns:
C: Drive path (MountPoint) - C:\Users\nathan.hurley\MyCompany\John Smith - ShareFolder
(UrlNameSpace) - https://mycompany.sharepoint.com/personal/john_smith_mycompany_com/Documents
Following the example above, if I'm trying to get the cloud OneDrive URL for:
C:\Users\nathan.hurley\MyCompany\John Smith - ShareFolder\Test
Replacing the C: Drive path with the UrlNameSpace will produce the following path:
https://mycompany.sharepoint.com/personal/john_smith_mycompany_com/Documents/Test.
The problem with this online link, is that it doesn't obtain the root synced folder and opening the link will lead to a 404 page error. The correct URL should be the following:
https://mycompany.sharepoint.com/personal/john_smith_mycompany_com/Documents/ShareFolder/Test
Again, I've noticed this issue only occurs with shared folders and within the Registry Editor, these folders also include an additional property called IsFolderScope. Is there an efficient way to determine which folders are Shared Folders other than checking the IsFolderScope property? Also, are shared folders the only folders that include this property?
Reference: https://tdalon.blogspot.com/2020/12/get-url-from-sync.html

Related

SharePoint Document Library( with Document Sets) - Items not visible

I am facing issue in a document library having a folder with a Document Set content type.
When I am uploading a document into a folder, it's uploaded successfully. but unfortunately, it's not appearing in that specific folder.
i.e.
The Document Library's name is Docs:
Docs Library Has many folders like Test, Test2, A, B, C,..Z.
I have uploaded the document into the A folder. upload successfully. but when investigating that folder (A Folder) it shows blank.
Document Library Url:
https://SharepointSite/sites/demo/docs
Folder Url :
https://SharepointSite/sites/demo/Docs/Forms/Document Set/docsethomepage.aspx?ID=14&FolderCTID=0x0120D52000753AFBDDB7855346B49428FBECC2D036&List=1b378e5e-6da5-4a18-bfe3-2de3dd57849b&RootFolder=/sites/demo/Docs/A&RecSrc=/sites/demo/Docs/A
One more thing.
When I search document name in the document library it's appearing. I have checked that the document properties. The URL is :
https://SharepointSite/:w:/r/sites/demo/_layouts/15/Doc.aspx?sourcedoc={C21982D1-933B-4328-8FA8-3CB8EBDCDDBA}&file=A.docx&action=default&mobileredirect=true
It's open and it's working.
But there's an issue with the folder, the document is not appearing in that folder.
Note:
We don't apply any filter over any views.
We don't apply any permission (Anyone can upload a document)**

Correctly enter the site_ID using Graph SDK

Regarding this expression to create a folder:
POST /sites/{site-id}/drive/items/{parent-item-id}/children
What is the correct way to enter the {site-id} and the {parent-item-id}, to access a folder (eg:folder_1) in a site (eg: site1)in a domain (eg: mydomain)
I have tried:
POST /sites/mydomain/drive/items/site1/folder_1/children
POST /sites:/mydomain/site1:/drive/items/folder_1/children
and similar, with no success,
Can you help me please?
THanks for the help.
Follow your steps, but In the second step, you say:
"This is the sub folder named "2019" in default Documents library:"
With this, I can acess the shared documents folder inside the site. I don't want to acess that folder. I need to acess another folder that is in the site, but not inside the share documents folder.
Any clue?
Do a get request like this in Graph Explorer with this request:
https://graph.microsoft.com/v1.0/sites/<host>:<server relative url>
Example:
https://graph.microsoft.com/v1.0/sites/zheguo.sharepoint.com:/sites/dev
Then will return site Id
Update if you want to access other library folder in Graph, firstly get drive id with this endpoint:
https://graph.microsoft.com/v1.0/sites/{site-id}/drives
Then access the specific drive folder with this endpoint:
https://graph.microsoft.com/v1.0/sites/{site-id}/drives/{drive-id}
Then for "parent-item-id", it's the specific folder id in document library, you can get with this endpoint:
https://graph.microsoft.com/v1.0/sites/{site-id}/drives/{drive-id}/items/root:
Example:
https://graph.microsoft.com/v1.0/sites/zheguo.sharepoint.com,91a47a59-db5e-4d17-a689-479ee8905533,274459c9-4c96-42bf-9b96-838ffa387aaa/drives/b!WXqkkV7bF02miUee6JBVM8lZRCeWTL9Cm5aDj_o4eqpLdqmLE2R7QosYOZt8Dyao/items/root:/
Then use the endpoint to create folder:
POST /sites/{site-id}/drives/{drive-id}/items/{parent-item-id}/children
Example:
https://graph.microsoft.com/v1.0/sites/zheguo.sharepoint.com,91a47a59-db5e-4d17-a689-479ee8905533,274459c9-4c96-42bf-9b96-838ffa387aaa/drive/items/01WU7SPCC4FNS6KOYTSJFK2MUFRITF5XQL/children
Reference:
Create a new folder in a drive

cannot add path of a folder stored in google drive

Subfolder 'gdrive' from the folder 'content' is not being recognized. This image is the screenshot of the error
No such file or folder exists :
you need to use the id of the google drive folder. google drive folder are accessible by their ids not names.
here is how you find the id of the folder link
You need a leading / in your path. For example, run:
from google.colab import drive
drive.mount('/content/gdrive')
%cd /content/gdrive

Delete files from Google drive using python through google drive api

I am trying to delete files from my google-drive using google drive apis for python.
I am able to retrieve the list of parents/children for a particular folder but when I try to delete one of the retrieved parent of the folder it gives me below error.
"https://www.googleapis.com/drive/v2/files/1j1sZ-0OAiTE9836bhTTpkUf3i4AFAvmG/parents/0AO-cNLqoD0BFUk9PVA? returned "Insufficient Permission">"
I have defined "https://www.googleapis.com/auth/drive" as my scope.
The same file got deleted when I tried "try this API" option from
developer-google.com but it does not work from my python code.
Is there anything else in the configuration that I need for deleting the files.
Thanks.

Docusign Template List Folder by name not working

All,
I have read and coded the following listed in documentation
https://docs.docusign.com/esign/restapi/Templates/Templates/list/
In above the following is shown
folder string
The query value can be a folder name or folder ID. The response will only return templates in the specified folder.
when I use folder id it's found but nothing is returned when I use folder name. I have verified that folder name matches
Also tried to use a "[{"name": "GTP"}]" but that will result in a error
HELP!
C#
templatesApi.ListTemplates(AccountId, new TemplatesApi.ListTemplatesOptions { sharedByMe = "true", folder = "GTP" }); // no results
templatesApi.ListTemplates(AccountId, new TemplatesApi.ListTemplatesOptions { sharedByMe = "true", folder = "bba1e719-1f38-4a1a-a8cc-03c4960de336" }); // works
It worked fine for me when I am using below API call and testing using Postman,
GET /restapi/v2/accounts/<accountId>/templates?folder=FolderName
As Amit says, the API call can use the name of a folder, but only if the folder is not a shared folder. To list the contents of a shared folder you need to use the folderId.
I have filed DocuSign internal bug report EC-1163. Please ask DocuSign customer service or your DocuSign technical contact to add your organization's information to the bug report. That will help increase its priority.
Workaround: Use the Shared Folder's id for the search.

Resources