Delegated permissions are often required for specific types of API calls where application permissions are not available. It is possible to use a delegated set of permissions for a Microsoft application when using the OAuth 2.0 integration in Torq.
To set up delegated access for Excel, OneDrive, Outlook, and SharePoint Steps, see the Microsoft 365 Delegated Access integration guide.
Create an application in Microsoft Entra ID
Open Microsoft Azure: Navigate to your Azure portal and go to Azure services > Microsoft Entra ID.
Register a new application: Go to Manage > App registrations and click New registration if a relevant app assigned to an Azure resource does not exist.
Enter a unique and meaningful name.
Give the account
Accounts in this organization directory onlyaccess.Click Register.
Open API permissions: In the application, go to API permissions and click + Add a permission.
Add permissions: Select an API endpoint such as Microsoft Graph, click Delegated permissions, select the relevant permissions, and then click Add permissions.
Open Certificates & secrets: In the application, go to Manage > Certificates & secrets.
Create a client secret: Select the Client secrets tab and click New client secret.
Enter a meaningful description/name.
Select an expiration date according to your organization's best practices.
Click Add.
Copy the secret: Copy the client secret Value to save it for later. You will need it to create the integration in Torq.
Open Authentication (Preview): Go to Manage > Authentication (Preview) and click + Add Redirect URI.
Add redirect URI: Click Web, paste
https://redir.torq.io/integrations/oauth_2(or the latest callback URL as provided by the integration setup) as the Redirect URI, and then click Configure.Copy the client and tenant IDs: Go to the application's Overview page and copy both the Application (client) ID and Directory (tenant) ID to save them for later. You will need them to create the OAuth 2.0 integration in Torq.
Create an OAuth 2.0 integration in Torq
Navigate to the integration: In Torq, go to Build > Integrations > Steps > OAuth 2.0 and click Add Instance.
Configure the integration:
Enter a meaningful name for the integration.
For Grant Type, select Authorization Code.
For Auth URL, paste
https://login.microsoftonline.com/<TENANT ID>/oauth2/v2.0/authorizewith the tenant ID you copied earlier.For Token URL, paste
https://login.microsoftonline.com/<TENANT ID>/oauth2/v2.0/tokenwith the tenant ID you copied earlier.Paste the client ID you copied earlier.
Paste the client secret you generated earlier.
For Scopes, paste
https://graph.microsoft.com/.default,offline_access.
Finalize: Click Continue. You will be forwarded to Microsoft to set up the delegated accessâthe account that is logged in to Microsoft on that browser will be the one to approve the access.

