Jul 14 2017 02:47 AM
I need make CSOM call, when I new a context, I need the site url. But I only have list document url, such as
https://XXX.sharepoint.com/teams/AAA/Shared Documents/
Should I remove last "Shared Documents/" to get site url ? Thanks.
Jul 14 2017 03:02 AM
Yes , you are correct, after removing /shared dodument/ you will get the site url.
Jul 14 2017 03:30 AM
Jul 14 2017 03:36 AM
Hi,
In basically site url forming like https//xxx.com/sites/sitename and your case https//xxx.com/teams/sitename so if you remove after site name you will get site url
Jul 15 2017 01:06 AM
Jul 15 2017 01:20 AM
Hi,
Refer the below Link for sharepoint URL structure
http://www.nothingbutsharepoint.com/2010/03/25/sharepoint-url-basics-aspx/
If you know Document libarry name then remove only the document libary name, you will get the site url, Or if yave have list name , you need to remove from /Lists/listname then you will get the site url
Jul 16 2017 05:33 AM
Jul 16 2017 11:42 PM
Jul 17 2017 12:03 AM
SharePoint list/library url is basically adding the library name to the site url and in your case it is like
Site URL https://XXX.sharepoint.com/teams/AAA/
Document Library URL is https://XXX.sharepoint.com/teams/AAA/ + Shared Documents i.e. https://XXX.sharepoint.com/teams/AAA/Shared Documents/
So to get the site url just remove the Shared documents
Jul 17 2017 03:30 AM
Can you give some more details on what you are trying to do.
If you are for example using CSOM you could get a list object using the list url and then via list.ParentWeb get the url of the site
Jul 17 2017 03:31 AM