Power Platform : Power Automate – calling SharePoint REST API

Power Automate - Adding HTTP operation action - "Send an HTTP request to SharePoint"
Power Automate - Adding HTTP operation action - "Send an HTTP request to SharePoint"

Hi All,

Greetings for the day!!!

Again small article – since I need to call SharePoint REST API from multiple different Power Automate so thought why not separate article on the same

Background :

  • In our project we have an requirement to send an email to users of SharePoint groups / members of SharePoint group from Power Automate
  • We have REST API to get the users from SharePoint group / members of SharePoint group – _api/web/sitegroups(6882)/users – here number in sitegroups is – Group Membership ID
  • So we need to call REST API from Power Automate and get the users email ids

Calling REST API from the Power Automate / How to call SharePoint REST APIs from Power Automate :

  • To call the REST API from Power Automate we have an HTTP operation action – “Send an HTTP request to SharePoint
  • Send an HTTP request to SharePoint” this action allows us to invoke SharePoint REST API
  • This action return results in JSON format

Demo :

  • Lets create a new – instant cloud flow – “Demo__RESTAPI_call”
  • For demo purpose we will trigger flow manually
Power Automate - creating an instant cloud flow
fig : Power Automate – creating an instant cloud flow
  • As we create flow manually, we will add an action “Send an HTTP request to SharePoint” from HTTP operation
Power Automate - Adding HTTP operation action - "Send an HTTP request to SharePoint"
fig : Power Automate – Adding HTTP operation action – “Send an HTTP request to SharePoint”
  • As in below fig, Power Automate provide us sample template / sample values
Power Automate - HTTP operation - "Send an HTTP request to SharePoint"
fig : Power Automate – Added HTTP operation action – “Send an HTTP request to SharePoint”
  • Lets call the simple REST API to fetch all the items of Document library – _api/web/lists/getbytitle(‘Documents’)/items
Power Automate - calling REST API to fetch all the items of Document library
fig : Power Automate – calling REST API to fetch all the items of Document library
  • As we specify respective following details, we are ready to test the flow
    • Site Address
    • Method
      • GET
    • REST API Uri – here, _api/web/lists/getbytitle(‘Documents’)/items
    • Header is optional
  • Lets test the flow
  • From right top corner – there is link – “Test” as shown in below fig
Power Automate - Testing the flow
fig : Power Automate – Testing the flow
  • As we click on “Test” link, we will have right pane – “Test Flow” – will open with following options
    • Manually
    • Atomically
  • For time being, we will go with “Manually” option
  • At the bottom there is “Test” button, click on it
fig : Power Automate - Power Automate - Testing flow - manually
fig : Power Automate – Testing flow – manually
  • On click of “Test” button we will have next pane – “Run flow” with option to start the flow
  • At bottom there is button “Run flow“, click on it to proceed with flow
Power Automate - Testing flow - Running flow
fig : Power Automate – Testing flow – Running flow
  • On successfully execution of flow, could see the flow execution details as in below fig
Power Automate - Testing flow - flow executed successfully
fig : Power Automate – Testing flow – flow executed successfully
  • We get the REST API result in JSON format as shown in below two figs
Power Automate - Output of REST API call  - JSON format
fig : Power Automate – Output of REST API call – JSON format
fig : Power Automate – Output of REST API call – JSON format
  • Note : How to parse this required JSON format and get the required values – we will discuss this in next article
  • We can also check the result from browser
  • Hit the respective REST API in browser as – <SharePoint site>/_api/web/lists/getbytitle(‘Documents’)/items
Executing SharePoint REST API from the browser
fig : Executing SharePoint REST API from the browser

Complete flow:

Power Automate - complete flow for calling SharePoint REST API
fig : Power Automate – complete flow for calling SharePoint REST API

Thanks for reading the article !!! Please feel free to discuss in case any issues / suggestions / thoughts / questions

HAVE A GREAT TIME AHEAD !!!

Prasham Sabadra

LIFE IS VERY BEAUTIFUL :) ENJOY THE WHOLE JOURNEY :) Founder of Knowledge Junction and live-beautiful-life.com, Author, Learner, Passionate Techie, avid reader. Certified Professional Workshop Facilitator / Public Speaker. Scrum Foundation Professional certificated. Motivational, Behavioral , Technical speaker. Speaks in various events including SharePoint Saturdays, Boot camps, Collages / Schools, local chapter. Can reach me for Microsoft 365, Azure, DevOps, SharePoint, Teams, Power Platform, JavaScript.

You may also like...

4 Responses

  1. July 14, 2022

    […] We have separate article for calling REST API from Power Automate, please have a look – Power Platform : Power Automate – calling SharePoint REST API […]

  2. October 11, 2022

    […] Next step is too add an action – “Send an HTTP request to SharePoint“. We have very good article on calling SharePoint REST API from Power Automate – https://knowledge-junction.in/2022/07/12/power-platform-power-automate-calling-sharepoint-rest-api/&#8230; […]

  3. October 11, 2022

    […] In one of our Power Automate we were using action – “Send an HTTP request to SharePoint“. We have very good article on calling SharePoint REST API from Power Automate – https://knowledge-junction.in/2022/07/12/power-platform-power-automate-calling-sharepoint-rest-api/ […]

  4. October 12, 2022

    […] Next step is too add an action – “Send an HTTP request to SharePoint“. We have very good article on calling SharePoint REST API from Power Automate – https://knowledge-junction.in/2022/07/12/power-platform-power-automate-calling-sharepoint-rest-api/ […]

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: