Prior to SharePoint 2019, SharePoint Administrators, SharePoint Developers, and Power Users could use SharePoint Designer for no-code workflow development. With the release of SharePoint 2019 and SharePoint Online, modern process automation is developed through Microsoft Flow. SharePoint Online leverages modern tools, like PowerApps and Flow for forms and workflow deployment.
As with SharePoint 2013 workflow, developers can execute REST calls to accomplish workflow actions. To test REST calls that will be executed in a Flow, a tool like Postman can be leveraged. To successful send REST calls, an access token will need to be obtained from Microsoft Azure Access Services. The below steps detail the process of obtaining an access token.
To begin, copy the text in the below box into notepad. This text is generalized headers for the body of the HTTP Post request to retrieve the token. The text in bold will be replaced as the steps to obtain the token are followed.
grant_type=client_credentials &resource=00000003-0000-0ff1-ce00-000000000000/TENANT-NAME[email protected]TENANT-ID &client_id= GENERATED CLIENT-ID@TENANT-ID &client_secret= GENERATED CLIENT-SECRET
Navigate to https://[TENANT -NAME].sharepoint.com/_layouts/15/appregnew.aspx
Note: Client Id generated during APP registration appended with an @, followed by the Tenant ID
<AppPermissionRequests AllowAppOnlyPolicy="true"><AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="Read"/></AppPermissionRequests>
5. Click Create
In notepad, update the text as detailed below:
Key | Value | Notes |
grant_type | client_credentials | |
resource | [SharePoint Online application principal ID]/[Tenant-Name][email protected][Tenant-ID] | [SharePoint Online application principal ID] is always 00000003-0000-0ff1-ce00-000000000000
[Tenant-Name] with the tenant value as it appears in the sharepoint.com URL for the tenant [Tenant-ID] was obtained on Site Setting > App Permissions The GUID on the right side of the @ is the Tenant ID
The / and @ are literal values. Use them where specified
|
client_id | [Client-ID]@[Tenant-ID]
|
Obtain this value by doing the following
Site Setting > App Permissions Locate the APP identifier that contains the Client Id generated during APP registration. Copy everything to the right of | (pipe) character.
|
client_secret | The client secret that was generated during APP registration |
To obtain the access token, send a POST request to Microsoft Azure Access Control Service (ACS) account associated with Tenant. The URL is in the following format:
https://accounts.accesscontrol.windows.net/[Tenant-ID]/tokens/OAuth/2 | [Tenant-ID] was obtained on Site Setting > App Permissions
The GUID on the right side of the @ is the Tenant ID
|
Key | Value |
Content-Type | application/x-www-form-urlencoded |
Copy the updated Body text from notepad into the Body of the postman request.
On success, the response body will contain an access-token key.
I hope that helped! If you still have any questions related to SharePoint Online, please don’t hesitate to reach out to us. We’d love to help you get started.
References
https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/add-in-permissions-in-sharepoint
https://docs.microsoft.com/en-us/sharepoint/hybrid/configure-server-to-server-authentication
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.