0

I have a sharepoint site, let's say http://sharepoint.company.com I'm trying to pull data from sharepoint.company.com/sites/one/sales/retail_locations.aspx

when I perform a get request on

http://sharepoint.company.com/_api/web/getfilebyserverrelativeurl('/sites/one/sales/retail_locations.aspx')

It keeps returning "The file /sites/one/sales/retail_locations.aspx does not exist"

I'm literally looking at the site in my other tab. It's driving me insane. Anyone have any idea what the problem is?

0

I think you are looking for a file at web level and your targeting site collection. So if you try to target the web level "/sites/one/sales" instead of site collection level "http://sharepoint.company.com" it would work.

the call to would be

http://sharepoint.company.com/sites/one/sales/_api/web/GetFileByServerRelativePath('/sites/one/sales/retail_locations.aspx')

Is there any particular reason to hit site collection level instead of web level.

All the best!!!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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