Creating a Connection and Action in PerfectApps |
Before building any connections to work with Microsoft data, we must start with one that returns a Bearer Token that will be used in subsequent actions.
Open your PerfectApps account and proceed to the Connections tab.
From the New button, start a new REST Web Service connection.
1. In the General section, enter a suitable name.
2. In the Permissions section, ensure that the Everyone account has Full Control.
3. In the Service Details section, enter the Service URL. The Service URL will be https://login.microsoftonline.com
Click Apply Changes to save the connection.
Changes to permissions can be applied to the connection only since no actions exist yet. |
Start a New Action.
1. In the General section, enter a suitable name.
2. For Type select POST.
3. In the Permissions section, ensure that the Everyone account has Full Control.
4. In the Action Endpoint box enter the Directory (tenant) ID saved in the New App Registration phase followed by '/oauth2/v2.0/token'.
5. For Request Type select Key.
6. For Response Type select JSON.
Click Apply Changes to save the action.
In the Send Parameters table, enter the following parameters:
Click Apply Changes.
The next step is to run a test connection to check that it works and to retrieve suitable return parameters.
Click the Test button and use the following values for each send parameter:
For client_id, use the Application Client ID saved earlier in the process.
For scope, use the https://graph.microsoft.com/.default (Please note the 'period' before the word default)
For client_secret, use the Client Secret - Value saved earlier in the process.
For grant_type, use the text client_credentials
Click the Connect button. Provided that the connection has worked, you will get a response like this:
Successful response
Status Code: 200
After a successful test, click the Auto Complete button in the Return Parameters section. The parameters are returned in a dialogue box; click the OK button to enter them in the table.
Be aware that the Return Parameters can also be entered manually. |
Click the Apply Changes button to save the Action.
The Bearer Token Action is complete and returns the Bearer Token via the ‘access_token’ parameter. The Bearer Token is then used in subsequent API requests.
We recommend that you run a new test using the same values mentioned above to check that a Bearer Token is returned. |
You may now proceed to build other actions that you need for integration with Microsoft.
Further information can be found here: https://learn.microsoft.com/en-us/entra/verified-id/get-started-request-api
Return to: Supported REST Web Services, Preparing to integrate with Microsoft, New App Registration