In this Rest API tutorial, we will discuss how to access Rest API using Postman in SharePoint Online or SharePoint 2013/2016/2019. Postman is one of the best tools which is used for API testing. In SharePoint, you can use Postman to check Rest API endpoints.
Access Rest API using Postman in SharePoint
Hi, techies today we’ll discuss how to test and perform basic operation’s in REST API’s for SharePoint using a powerful and user-friendly tool POSTMAN. This will work for SharePoint 2016/2013 or SharePoint Online sites. Primarily, we need to get it installed from this below link.
Once installed it will then add it to the Chrome Launcher which is great for easy access. Once you have it installed we can launch it and should be presented with the following:
SharePoint 2013 adds the ability for you to remotely interact with SharePoint sites by using REST. Now, you can interact directly with SharePoint objects by using any technology that supports standard REST capabilities.
To access SharePoint resources using REST, construct a RESTful HTTP request, using the Open Data Protocol (OData) standard, which corresponds to the desired client object model API. For example:
We can perform the below operation in Postman
GET– Use GET to retrieve data from SharePoint like list, list items, etc.
POST – Use POST to create entities such as lists and sites. The SharePoint 2013 REST service supports sending POST commands that include object definitions to endpoints that represent collections.
For POST operations, any properties that are not required are set to their default values. If you attempt to set a read-only property as part of a POST operation, the service returns an exception.
PUT– Use PUT and MERGE operations to update existing SharePoint objects.
Any service endpoint that represents an object property set operation supports both PUT requests and MERGE requests.
For MERGE requests, setting properties is optional; any properties that you do not explicitly set retain their current property.
For PUT requests, if you do not specify all required properties in object updates, the REST service returns an exception. In addition, any optional properties you do not explicitly set are set to their default properties.
DELETE– Use the HTTP DELETE command against the specific endpoint URL to delete the SharePoint object represented by that endpoint. In the case of recyclable objects, such as lists, files, and list items, this results in a Recycle operation.
Check How to clear SharePoint cache
Get the site Title:
https://<tenantname>.sharepoint.com/sites/Bhawana/_api/web/title
Get particular list data:
https://<tenantname>.sharepoint.com/sites/Bhawana/_api/lists/getbytitle('Bhawana_Practice')/items
Get all the Lists:
https://<tenantname>.sharepoint.com/sites/Bhawana/_api/lists
Create a SharePoint LIST using below Json:
{
'_metadata':{'type':SP.List},
'AllowContentTypes': true,
'BaseTemplate': 104,
'ContentTypesEnabled': true,
'Description': 'My list description',
'Title': 'RestTest'
}
You may like the following SharePoint Rest API tutorials:
- SharePoint list operations using rest api
- SharePoint rest api create folder
- Display SharePoint list data in jQuery data table using Rest API
- SharePoint Rest API Microsoft.SharePoint.Client.InvalidClientQueryException The expression is not valid. Bad Request
- How to get SharePoint list items using Rest API in Microsoft Power Automate
- How to get documents from document library in SharePoint using Rest API
- Create custom SharePoint Survey poll using REST API and AngularJS
- Retrieve and Display TASK status using REST API in SharePoint
- Create a Custom Calendar in SharePoint using Rest API and jQuery
- crud operations using rest api SharePoint Online
This tutorial explains, how to use Postman tool to test Rest API in SharePoint Online or SharePoint 2013/2016. We saw how we can do GET, POST, MERGE, PUT, DELETE, etc. operations in SharePoint using Postman.
Bhawana Rathore is a Microsoft MVP (3 times in Office Apps & Services) and a passionate SharePoint Consultant, having around 10 years of IT experience in the industry, as well as in .Net technologies. She likes to share her technical expertise in EnjoySharePoint.com and SPGuides.com
Have u forgotten add steps to get auth token to access the resources?
After I execute the command, The error shown 401 UNAUTHORIZED, How can I solve it?
Thank you.
May I ask about how to setup the authorization Part? Because you blog only shown half part only.
May I know how to upload a file using REst API for the announcement item
Hi Bhawana, Can u please suggest how we can create share links from REST apis.