This guide describes how to retrieve and use action-specific URLs for Enterprise Admins to complete registration, login, or grant consent for Microsoft Teams integrations. These URLs are retrieved using the getActionItemUrl API and are essential for enabling various Teams-based services through the ConnecttoTeams platform.
Overview
You can generate URLs for the following admin actions:
Enterprise registration
Enterprise admin login
Microsoft Teams service consents (e.g., user sync, presence, call recording)
These URLs are presented to the Enterprise Global Admin (GA), who completes the action. The outcome is returned to your application via a webhook or redirect URL, depending on the action type.
Supported Action Types
This table outlines the valid actionType values and corresponding content type for the enterprise/getActionItemUrl endpoint.
Action Type | Consent Type | Use |
|---|---|---|
| - | To get the URL with which the Global Admin (GA) can start the enterprise registration process. |
| To get the URL with which the Global Admin (GA) can login to the system thereby getting their msalAuthentication token. This token can be used to access other Graph API calls, such as for deploying apps to MS Teams.
| |
|
| MANDATORY To get the URL to which the GA can consent to accessing and updating the MS Teams users data. This is needed for configuring services to Teams Users such as PBX and SMS. |
|
| MANDATORY for calling services To get the URL with which the GA can consent to access Presence status of Teams users. The presence status is used in the following services: CallApp Add-on |
|
| MANDATORY for CallApp Add-on To get the URL with which the GA can consent to access MS Teams in order for CallApp Add-on to function. |
|
| OPTIONAL To get the URL with which the GA can consent to allow sync’ing with Outlook and Microsoft Organization contacts. Useful for contacts management feature of the following apps: SMS Connector |
|
| OPTIONAL To get the URL with which the GA can consent to allow access to call records in Teams. Useful to allow Service Provider to get more call details to debug call issues. |
|
| MANDATORY for Call Recording Add-on To get the URL with which the GA can consent to access MS Teams in order for Call Recording to function. This includes creating the Compliance Recording Policy in the Microsoft Teams tenant. |
|
| OPTIONAL To get the URL with which the GA consent to allow Service Provider to do most management tasks on GA’s behalf. This includes provisioning users, syncing users, and create direct routes among others. |
|
| MANDATORY |
Retrieve the action URL
API Endpoint
Method:
POSTPath:
/enterprise/getActionItemUrlToken to use: Reseller-level Bearer Token
Request Body (JSON){ "actionType": "<actionType>", "enterpriseName": "<enterpriseName>", "redirectUrl": "<redirectUrl>" }Required Fields
actionType- see Action Type Values table above.enterpriseNameredirectUrl- Your webhook URL that will receive the response payloadAPI Response
The API returns a string containing a URL. This URL leads the user to the appropriate Microsoft consent screen.
Sample cURL Request
curl --silent --location --request POST 'https://api.connecttoteams.com/enterprise/getActionItemUrl' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <access_token>' \ --data-raw '{ "actionType": "REGISTRATION", "redirectUrl": "https://yourapp.com/callback", "enterpriseName": "AcmeCorp" }'Sample Response
https://login.microsoftonline.com/common/oauth2/v2.0/authorize?response_type=id_token+code&client_id=<client_id>&nonce=6457573502311203778&response_mode=form_post&state=<state>&scope=openid Directory.ReadWrite.All Directory.AccessAsUser.All TeamsAppInstallation.ReadWriteForUser Organization.Read.All User.ReadWrite.All 48ac35b8-9aa8-4d74-927d-1f4a14a0b239/user_impersonation&redirect_uri=https://api.connecttoteams.com/restricted/handleResponsePresent the URL to the Enterprise Global Admin
Display the retrieved URL in step 1 as either a clickable hyperlink or a redirect button in your own portal.
When this URL is clicked, the Global Admin is prompted to follow the actions presented — such as consenting to some permissions.Handle the data posted to your provided
redirectURL.a. For Registration & Login, a JSON object is posted to the provided
redirectUrlafter the process is completed.Sample JSON Object Response on Registration or Login Actions:
{ "msalAuthenticationResult": { "authenticationResult": { "accessToken": "eyJ0eXAiOiJKV1QiLCJub25j...", "accessTokenType": "login.microsoftonline.com", "expiresAfter": null, "expiresOn": 1742985175242681, "expiresOnDate": null, "idToken": "rZ7VeEm5tG2nlBZ6MAfW-...", "multipleResourceRefreshToken": false, "refreshToken": null, "userInfo": { "displayableId": "admin@example.com", "identityProvider": "user", "tenantId": "5c0068f3-dfbb-..." } }, "resellerId": null, "tenantId": null }, "organization": "MSFT", "officeUserType": "GLOBAL_ADMIN", "companyAdmin": true, "containsTeamsTenantAdminAPI": true }b. For other consent actions, a message is sent as a query parameter, and the user is redirected to the provided
redirect URL.Sample Redirect on Success:
https://yourapp.com/callback?success=User Sync Consent Completed SuccessfullySample Redirect on Error:
https://yourapp.com/callback?error=Unable to Complete the process. User is not a Global AdminQuery parameter values are displayed without URL encoding for better readability.
If action has an applicable consent type, update App Consent for the Enterprise
Method:POSTPath:
/provisioning/updateAppConsent/{type}Token to use: Enterprise-level Bearer Token
Request Body (JSON){ "authenticationResult": { "authenticationResult": { "accessToken": "eyJ0eXAiOiJKV1QiLCJub25jZSI6IjdKbXh..............", "accessTokenType": "login.microsoftonline.com", "expiresOn": 1743285790991831, "idToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1..............", "multipleResourceRefreshToken": false, "userInfo": { "displayableId": "user@example.com", "identityProvider": "user", "tenantId": "tenantId" } } } }
Required Fieldstype : The string value related to the consent granted. The possible values are
CDR, Presence, UserSync, EnterpriseManagement, Valet, Agent, Contacts, CallRecording
API ResponseOn success, the API returns
200 OK