This guide outlines a specific use case for leveraging the ConnecttoTeams API to configure and deploy the ConnecttoTeams Unified App. While the ConnecttoTeams service is also available in other Teams applications tailored to individual services, those apps are outside the scope of this document.
Part I: Add CallApp Add-on to Enterprise
Enable CallApp for Enterprise
If Enterprise is not yet created, create the Enterprise:
Follow the guide in Creating and Registering an Enterprise with Restricted Access, but be sure to pass the value [
PBX","CALLAPP"]
to theservices
instead.Proceed to follow the rest of the Creating and Registering an Enterprise with Restricted Access guides to complete the PBX configuration.
If Enterprise is existing with PBX enabled, add the CallApp Add-on to the Enterprise
Edit the enterprise to add the CALLAPP to the
services
attribute.See the API call details here: Common API Methods > Edit Enterprise.
Get CallApp Consent
Follow the Common Workflow > Get Action URL, Present to Global Admin, Process the Webhook and ensure to pass a value of
GET_CALL_APP_CONSENT
to the fieldactionType
.Sync the Unified App
Follow the instruction here: Common API Methods > Sync Unified App.
Part II: Configure CallApp Service Account and Users
Set up Call App Service Account
This creates the callappservice@<domain> user. Do not delete this user.
API Endpoint
Method:
POST
URL:
/valet/configureValetServiceAccount
Request Body (JSON)
{ "authenticationResult": { "accessToken": "eyJ0eXAiOiJKV1QiLCJub25jZSI6I.......", "accessTokenType": "login.microsoftonline.com", "expiresOn": 1743105617860946, "idToken": "eyJ0eXAiOiJKV1QiLCJh........", "multipleResourceRefreshToken": false, "userInfo": { "displayableId": "[email protected]", "identityProvider": "user", "tenantId": "<tenantid>" } } }
Example cURL Command
curl --silent --location --request POST 'https://api.connecttoteams.com/valet/configureValetServiceAccount' \ --header 'Authorization: Bearer eyJraWQiOiJlYTdiZmRkYi02........' \ --header 'Content-Type: application/json' \ --data-raw '{ "authenticationResult": { "accessToken": "eyJ0eXAiOiJKV1QiLCJub25jZSI6ImdjMmxY..........", "accessTokenType": "login.microsoftonline.com", "expiresOn": 1743105617860946, "idToken": "eyJ0eXAiOiJKV1QiLCJ...........", "multipleResourceRefreshToken": false, "userInfo": { "displayableId": "[email protected]", "identityProvider": "user", "tenantId": "<tenantid>" } } }'
API Response
On success, the API returns
200 OK
Configure CallApp Users
API Endpoint
Method:
POST
Path:
/valet/configureValetUser
Request Body (JSON)
{ "pbxCallPolicyInfo": { "callPolicyCNAM": "TRANSPARENT", "callPolicyName": "Global", "forwardedCallsCallerId": "USER_CALLER_ID" }, "authenticationResult": { "authenticationResult": { "accessToken": "eyJ0eXAiOiJKV1QiLCJub25jZSI6IjdKbXh..............", "accessTokenType": "login.microsoftonline.com", "expiresOn": 1743285790991831, "idToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1..............", "multipleResourceRefreshToken": false, "userInfo": { "displayableId": "[email protected]", "identityProvider": "user", "tenantId": "<tenantid>" } } }, "userType": "Service", "directRouteId": 806, "useTeamsVoicemail": false, "password": "<password>", "rePassword": "<password>", "pbxAuthUserId": "104", "pbxLocation": "<pbx location>", "pbxUserId": "104", "phoneNumber": "14139301634", "portalLoginName": "", "portalPassword": "", "teamsUserId": "[email protected]", "useEnterpriseDialPlan": true, "tenantID": "<tenant-id>", "loginID": "<[email protected]>", "sipAutoProvisioningEnabled": false, "useAudioConferenceVRP": false, "userTag": "" }
Required Fields
directRouteId
password
pbxAuthUserId
pbxUserId
phoneNumber
pbxLocation
teamUserId
authenticationResult
API Response
On success, the API returns
200 OK
Sync Teams Users
Any changes in the users as mentioned in the above step is applied only to ConnecttoTeams databases and the PBX instance. The change need to be pushed to Microsoft as well so that the Teams User will actually be able to receive and make calls thru the PBX.
See the API call details here: Common API Methods > Sync Teams Users.