0

I am building SharePoint add-in on Office 365 based on angular JS. I followed another article here to try and read documents from a folder in a document library from the HostWeb.

here is the URL being created for the Get request

/_api/SP.AppContextSite(@target)/web/getfolderbyserverrelativeurl('EverythingTechnical_id2_Documents/Projects')/files?$select=EncodedAbsUrl,FileDirRef,FileRef,FileLeafRef,FSObjType,Modified,Author/ID,Author/Title&$expand=Author/ID,Author/Title&@target='https://SiteName.sharepoint.com/sites/dev'

and here is the response

Object { data: "", status: 404, headers: headersGetter/<(), config: Object, statusText: "Not Found" }

now I have gone over it several times and that should be OK so to check I used RESTClient in safari to do some testing and it works!

Why Do I get error 404 with Not Found in my app? Whats Not Found?

1 Answer 1

0

I did some more investigating and copied a working header, then posted its url side by side and found it almost immediately, should stand out!

_api/SP.AppContextSite(@target)/web/lists/getbytitle
/_api/SP.AppContextSite(@target)/web/getfolderbyserverrelativeurl

leading / is not supposed to be there :|- Hope that helps someone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.