none
Accessing Shared Folders in a Sub Site via REST Apis RRS feed

  • Question

  • I have a sharepoint .com site at companyname.sharepoint.com.

    I created another subsite at companyname.sharepoint.com/sites/dev. I want to upload a file via rest to the Shared Documents folder under that site. What would the REST URL be.

    Referring the URL syntax Diagram @http://msdn.microsoft.com/en-us/library/office/dn450841.aspx

    it should be 

    http://companyname.sharepoint.com/dev/_api/web/...

    However that does not work.

    even 

    http://companyname.sharepoint.com/sites/dev/_api/web/...

    Does not work.

    Any Ideas

    Atul

    Wednesday, December 11, 2013 7:47 PM

Answers

  • You have to remove the forward slash "/" before "Shared Documents".

    https://companyname.sharepoint.com/sites/dev/_api/web/GetFolderByServerRelativeUrl('Shared Documents') should work.


    These postings are provided "AS IS" with no warranties, and confers no rights.

    Thursday, December 12, 2013 9:54 AM

All replies

  • http://companyname.sharepoint.com/sites/dev/_api/web/ should be the URL for REST endpoint.

    When you say it does not work, what do you see happen actually? How are you trying to access this URL? Have you tried accessing this URL directly from IE browser?


    These postings are provided "AS IS" with no warranties, and confers no rights.

    Wednesday, December 11, 2013 8:19 PM
  • https://companyname.sharepoint.com/sites/dev/_api/web/GetFolderByServerRelativeUrl('/Shared%20Documents')

    <m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">

    <m:code>
    -2147024809, System.ArgumentException
    </m:code>
    <m:message xml:lang="en-US">
    Value does not fall within the expected range.
    </m:message>

    </m:error>

    Wednesday, December 11, 2013 11:02 PM
  • You have to remove the forward slash "/" before "Shared Documents".

    https://companyname.sharepoint.com/sites/dev/_api/web/GetFolderByServerRelativeUrl('Shared Documents') should work.


    These postings are provided "AS IS" with no warranties, and confers no rights.

    Thursday, December 12, 2013 9:54 AM
  • Thanks , That did work. So one thing that threw me off was that on the main site, the '/' works, on the sub site it does not

    Again Thanks

    Atul

    Thursday, December 12, 2013 1:07 PM