Sharepoint Rest Api


Working with the SP Rest Api i found some basics that are here to remember.

get by title
var u = "/sites/newportal/_api/Web/lists/getbytitle('Site Pages')/items"

select person field
u += "?$select=Title,Assigned_x0020_To0/Name,FileRef,FileDirRef" +
         "&$expand=Assigned_x0020_To0"

get folder
var u = "/sites/newportal/_api/Web/GetFolderByServerRelativePath" + 
             "(decodedurl='/sites/newportal/SitePages/NewEmp')/Files?$select=*"

but to really get a person data by folder in site pages i had to use search

var u = "/_api/search/query?" +
            "querytext='ParentLink:NewEmp'" +
            "&selectproperties='Path,Title,AssignedTo0OWSUSER'"

Comments

Popular posts from this blog

OverTheWire[.com] Natas Walkthrough - JUST HINT, NO SPOILERS

Asp.Net Ending Response options, Response.End() vs CompleteRequest()

SOLVED The item could not be indexed successfully because the item failed in the indexing subsystem