Skip to main content

Commonly used REST API URLs in SharePoint 2013

In SharePoint 2010 Rest API was limited to for fetching the list data, in SharePoint 2013 Rest API covers all the functionality covered by CSOM. Please find below a list of all the Sharepoint Rest API end points.

_spPageContextInfo.webServerRelativeUrl will return the relative url which can be combined with _api part.
  
Rest API URL
Description
Site collection object
Site object
Site collection URL property
Site list collection
Site lists collection Method
List items collection, selects all the fields in the Contacts list
$select=Title

Select title field in contacts list
$select=Title,Description&$order=Modified

Select title and description field and order by last modified date.
$filter=FirstName eq ‘Dinesh’
Returns the item from the contact list for which the first name is Dinesh
$filter=startswith(FirstName,’D’)
Returns all items from the contacts list for which the first name starts with D
$filter=month(Modified) eq 4
Returns all items from the contacts list modified in April.
Returns the first five items in the contacts list.
getmyProperties
For getting the user profile properties
getmyProperties(@v)?@v=’Dinesh’
For getting the user profile properties of the Dinesh.
For getting all the groups of a site object.
For getting all the users of a group.
Used to run search queries by using HTTP Get
Used to run search queries by using HTTP post to overcome Url length limitations
Used to retrieve query suggestions by using Http Get



These are some of the basic REST API urls which we use frequently. I will be updating the above list with some more REST API urls. 

Comments

Popular posts from this blog

Sharepoint 2013 REST API limitations with site columns

Recently i attended an interview for one of the company, the interviewer asked me a question on rest api. How to get a publishing image field using rest api? I answered its the normal way how we get the other fields. But later i came to know that its the wrong answer. After some research on Google came to know that there some limitations to rest api in sharepoint 2013. Below is a list of columns available using Rest api. Column Support Notes Hyperlink or Picture Supported Single Line of Text Supported Multiple lines of text :: Plaintext Supported Multiple lines of text :: Richtext Supported Returns unencoded XHTML Multiple lines of text :: Enhanced Richtext Supported Returns unencoded XHTML Choice Supported Column is required in the  $expand  keyword Counter Supported Integer Supported Number Supported Currency Supported Date Supported Returns an ISO 8601 date e.g. 2013-03-08T11:00:00 Yes/No Supported Returns true or false string literals Person or Group Suppo...

How to upgrade typescript version in a SPFX solution

Why do we need to upgrade typescript version in a SPFX solution? As part of SPFX development we try to install 3 rd party libraries, there is a possibility that we might face type errors. For example, if we try to install ANTD package as part of your solution and use one of its components and try to build the solution. You might be seeing the type errors (TS1005,TS1109) as shown below. Typescript errors How to find out the typescript version? When you build (Gulp build) the SPFX solution you will be able to find out the typescript version from the build log as shown below.  Steps for updating the Typescript version. In SPFX solution typescript version has dependency on the @Microsoft/rush-stack-compiler package version.  In the package.json if you have @microsoft/rush-stack-compiler-2.7 then the typescript version is 2.7.x.    In the SPFX solution deleted the node_modules folder. It will remove all the packages that are installed....

Microsoft Graph API and SharePoint

While developing solutions for office 365 Microsoft graph API will help you in achieving the required output. In my previous project where I have used Graph API, I found it difficult for getting info on some of the endpoints. Below I will try to list out some of the basic and most used end points of Microsoft graph API for SharePoint. Getting site level information Searching for Sites https://graph.microsoft.com/v1.0/sites?search=* it returns the list of site collections the user have permission. Site details based on the relative path https://graph.microsoft.com/v1.0/sites/{host-name}:/{server-relative-path} if the site collection url is https://contoso.sharepoint.com/sites/test1 Host-name:- contoso.sharepoint.com Server relative path:- sites/test1 Graph Url:- https://graph.microsoft.com/v1.0/sites/contoso.sharepoint.com:/sites/test1 Different ways to get list data Get the list data for a root site https://graph.microsoft.com/v1.0/sites/root/...