https://www.youtube.com/watch?v=RjmabDfMJG0
Using HTTP, We need client id and client secret. No matter which user is running the flow.
For that we need to register our power app to the SharePoint site at site collection level.
We will register the app with client id and client secret.
This way in our flow, we are not going to use any individual user connections with SharePoint permissions impact.
First we need to register the site at site collection level
https://plainsmidstream.sharepoint.com/sites/maximo/_layouts/15/appregnew.aspx
The app identifier has been successfully created.
Client Id: 07707f52-04ca-4a23-a330-0b42d33ef82b
Client Secret: z1h/bHkecXPmguEMGiVG59D4HBOveIjbGvEKNA8VyX0=
Title: Access Request to SharePoint Power App
App Domain: www.localhost.com
Redirect URI: https://www.localhost.com
Now open appinv.aspx
https://plainsmidstream.sharepoint.com/sites/maximo/_layouts/15/appinv.aspx
In app id, past the client id which already registered. click on lookup.
We are doing as Grant access at site collection level to the users to run our app. API will always call based on full control.
We have an XML code available as below.
https://github.com/Dhruvinshah16/Power-Automate/tree/master/Call%20SharePoint%20API%20as%20Admin%20Consent
Do you trust Access Request to SharePoint Power App?
Let it have full control of this site collection.
Let it share its permissions with other users. Access Request to SharePoint Power App
Let it access basic information about the users of this site.
Tenant ID:
In order to get tenant ID
Open https://portal.azure.com/
Click on left navigation, Azure Active Directory
You can see tenantID, copy it.
We need to call our sharepoint rest api with admin user.
To call the restapi with admin user, we need access token.
Access token can be identified with HTTP request.
In actions, type HTTP(premium)
Method: POST
URI:https://accounts.accesscontrol.windows.net/<your tenand id>/tokens/OAuth/2
Headers:
Content-Type | application/x-www-form-urlencoded
Comments
Post a Comment