Common API Methods

Prev Next

Configure Direct Routing

API Endpoint

Method: POST

Path: /provisioning/provisionDirectRouting

Request Body (JSON) With Required Fields only

{
    "authenticationResult": {
        "authenticationResult": {
            "accessToken": "string",
            "accessTokenType": "string",
            "expiresAfter": 0,
            "expiresOn": 0,
            "expiresOnDate": "2025-03-07T12:46:35.173Z",
            "idToken": "string",
            "multipleResourceRefreshToken": true,
            "refreshToken": "string",
            "userInfo": {
                "displayableId": "string",
                "identityProvider": "string",
                "tenantId": "string"
            }
        }
    },
    "sbcGatewayId": 0
}

Example cURL Command

curl --silent --location --request POST 'https://api.connecttoteams.com/provisioning/provisionDirectRouting' \
--header 'Authorization: Bearer eyJraWQiOiJlbbQo.....' \
--header 'Content-Type: application/json' \
--data-raw '{
    "authenticationResult": {
        "authenticationResult": {
            "accessToken": "eyJ0eXAiOiJKV1QiLCJub25jZSI6Ikx6eFQyU.....",
        "accessTokenType": "login.microsoftonline.com",
        "expiresOn": 1743097299177667,
        "idToken": "eyJ0eXAiOiJKV1Q.....",
        "multipleResourceRefreshToken": false,
        "userInfo": {
            "displayableId": "<ent-admin-id>",
            "identityProvider": "user",
            "tenantId": "<tenant-id>"
            }
        }
    },
    "sbcGatewayId": 805
}'

Response

On success, the API returns

200 OK

Configure Unified App Settings for an Enterprise

The method described here pertains to the API method to configure the Unified app settings as depicted in this page from the Service Portal.

API Endpoint

Method: POST

Path: /reseller/saveOrUpdateTeamsApplicationTemplate

Request Body (JSON)

{
  "enterpriseId": 12345,
  "resellerId": 67890,
  "name": "Sample Unified App",
  "bIconFileName": "branding_icon.png",
  "oIconFileName": "outline_icon.png",
  "portalURL": "https://portal.example.com",
  "ssoURL": "https://sso.example.com",
  "type": "UNIFIED",
  "portalTabName": "PBX",
  "brandingImageInBytes": "Base64EncodedString",
  "outlineImageInBytes": "Base64EncodedString",
  "turnOffCard": false,
  "turnOffVMCard": true,
  "showCard": true,
  "showVMCard": false,
  "tenantID": "tenant-12345",
  "teamName": "Sample Team",
  "allowEnterpriseToOverride": true,
  "sendMessageNotificationOnZeroMessages": false,
  "tabOrder": [],
  "fcTabName": "Features",
  "accentColor": "#FF5733",
  "version": "1.0.0",
  "packageName": "com.example.app",
  "devName": "Example Devs",
  "privacyURL": "https://privacy.example.com",
  "termsURL": "https://terms.example.com",
  "shortName": "Example Comm",
  "fullName": "Example Communications App",
  "shortDesc": "A short description of the app",
  "fullDesc": "A detailed description of the app and its features",
  "showUtilityCard": true
}

Configure PBX

This method is used to create or update a PBX Location of an Enterprise.

API Endpoint

Method: POST
Path: /pbx/updatePBXSettingsForTenant

Request Body (JSON)

{
    "codecs": [
        "G.711 A-law",
        "G.711 U-law"
    ],
    "dnsLookupType": "Host",
    "domainAliases": [],
    "pbxIdOrPBXLocationId": 7,
    "pbxLocationName": "broadworks",
    "pbxSIPDomain": "<pbx-sip-domain>",
    "pbxSIPDomainProxy": "",
    "pbxSIPDomainProxyPort": 5060,
    "presencePackageType": "call-info",
    "regExpiresValue": 600,
    "tenantID": "tenant-id",
    "transportType": "UDP",
    "update": false,
    "voicemailFeatureCode": "*62",
    "topologyHiding": false,
    "pbxCallPolicyInfo": {
        "callPolicyCNAM": "TRANSPARENT",
        "callPolicyName": "Global",
        "forwardedCallsCallerId": "USER_CALLER_ID"
    },
    "metaSwitchSubscriptionCompatibility": false,
    "sipWaitForAlegAck": true,
    "enforceCodecsOnInbound": false,
    "enableMWIEvents": false,
    "rejectMethod": "SIP 480",
    "rejectCalling": false,
    "rejectInterval": 0,
    "acceptsEncodedFeatureCode": false,
    "escapeRequestUri": false,
    "convertHistoryInfoToDiversion": false,
    "oldStyleHold": false
}

Required Fields

tenantId

pbxSIPDomain

transportType

pbxSIPDomainProxy

voicemailFeatureCode

pbxLocationName

dnsLookupType

update

pbxIdOrPBXLocationId

Example cURL Command

curl --silent --location --request POST 'https://api.connecttoteams.com/pbx/updatePBXSettingsForTenant' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJraWQiOiJlYTdiZm.....' \
--data-raw '{
    "codecs": [
        "G.711 A-law",
        "G.711 U-law"
    ],
    "dnsLookupType": "Host",
    "domainAliases": [],
    "pbxIdOrPBXLocationId": 7,
    "pbxLocationName": "broadworks",
    "pbxSIPDomain": "yahoo.com",
    "pbxSIPDomainProxy": "",
    "pbxSIPDomainProxyPort": 5060,
    "presencePackageType": "call-info",
    "regExpiresValue": 600,
    "tenantID": "5c0068f3-dfbb-4f4a",
    "transportType": "UDP",
    "update": false,
    "voicemailFeatureCode": "*62",
    "topologyHiding": false,
    "pbxCallPolicyInfo": {
        "callPolicyCNAM": "TRANSPARENT",
        "callPolicyName": "Global",
        "forwardedCallsCallerId": "USER_CALLER_ID"
    },
    "metaSwitchSubscriptionCompatibility": false,
    "sipWaitForAlegAck": true,
    "enforceCodecsOnInbound": false,
    "enableMWIEvents": false,
    "rejectMethod": "SIP 480",
    "rejectCalling": false,
    "rejectInterval": 0,
    "acceptsEncodedFeatureCode": false,
    "escapeRequestUri": false,
    "convertHistoryInfoToDiversion": false,
    "oldStyleHold": false
}'

Response

On success, the API returns

true

Edit Enterprise

API Endpoint

Method: PUT

Path: /reseller/editEnterprise

Request Body (JSON)

{
    "canAddExtensions": false,
    "canResellerManageEnterpriseProvisioning": false,
    "secureSMSEnabled": false,
    "enterpriseId": 701,
    "enterpriseName": "enterprise_name",
    "pbxId": [0],
    "pbxMOH": false,
    "registeredBy": "[email protected]",
    "resellerId": 999,
    "sbcGateways": [0],
    "services": [
        "PBX",
        "SMS",
        "CALLAPP",
        "CHAT"
    ],
    "userLimit": -1,
    "allowExternalNumbers": true,
    "userProvisioningEnabled": true,
    "restrictAdminAccess": true
}

Required Fields

enterpriseName (String) - The name of the enterprise to be created. This field is mandatory as it uniquely identifies the enterprise in the system.

pbxId (Array of Integers) - The ids of the PBX Types if using PBX service.

sbcGateways (Array of Integers) - The ids of the Session Border Controller (SBC) gateways if using either PBX and/or Trunk service.

services (Array of Strings) - Defines the services enabled for the enterprise. Expected values include PBX, Trunk, SMS, CALLAPP, CallRecording, and CHAT.

registeredBy

Response

On success, the API returns

true

Sync Unified app

API Endpoint

Method: POST

Path: /provisioning/provisionChatApplication

Request Body (JSON)

{
  "authenticationResult": {
    "authenticationResult": {
      "accessToken": "eyJ0eXAiOiJKV1QiLCJub25jZSI6IjdKbXh..............",
      "accessTokenType": "login.microsoftonline.com",
      "expiresOn": 1743285790991831,
      "idToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1..............",
      "multipleResourceRefreshToken": false,
      "userInfo": {
        "displayableId": "[email protected]",
        "identityProvider": "user",
        "tenantId": "tenantId"
      }
    }
  }
  "templateType": "UNIFIED"
}

Required Field

templateType = UNIFIED

API Response

On success, the API returns

200 OK

Sync Teams Users

This task may be carried out using an Enterprise access or, if GET_SERVICE_PROVIDER_MANAGEMENT_CONSENT has been granted, using the Reseller access.

API Endpoint

Method: POST

Path: /provisioning/syncTeamsRegistrations

Request Body (JSON)

{
    "authenticationResult": {
        "accessToken": "eyJ0eXAiOiJKV1QiLCJub25jZSI6I.......",
        "accessTokenType": "login.microsoftonline.com",
        "expiresOn": 1743105617860946,
        "idToken": "eyJ0eXAiOiJKV1QiLCJh........",
        "multipleResourceRefreshToken": false,
        "userInfo": {
            "displayableId": "[email protected]",
            "identityProvider": "user",
            "tenantId": "5c0068f3-df..."
        }
    }
}

API Response

On success, the API returns

200 OK

Verify Tenant for Direct Routing

The operation to verify the readiness to set up Direct Routing for a Microsoft Office365 Organization.

API Endpoint

Method: POST

Path: /provisioning/verifyTenantForDR

Request Body (JSON)

{
    "authenticationResult": {
        "accessToken": "eyJ0eXAiOiJKV1QiLCJub25jZSI6Ikx6.......",
        "accessTokenType": "login.microsoftonline.com",
        "expiresOn": 1743097299177667,
        "idToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSU.....",
        "multipleResourceRefreshToken": false,
        "userInfo": {
           "displayableId": "<ent admin id>",
            "identityProvider": "user",
            "tenantId": "<tenant Id>"
        }
    }
}

Example cURL Command

curl --silent --location --request POST 'https://api.connecttoteams.com/provisioning/verifyTenantForDR' \
--header 'Authorization: Bearer eyJraWQiOiJlYTdi........' \
--header 'Content-Type: application/json' \
--data-raw '{
    "authenticationResult": {
        "accessToken": "eyJ0eXAiOiJKV1QiLCJ ......",
        "accessTokenType": "login.microsoftonline.com",
        "expiresOn": 1743093181665540,
        "idToken": "eyJ0eXAiOiJKV1QiLCJhbGciOi.....",
        "multipleResourceRefreshToken": false,
        "userInfo": {
            "displayableId": "<ent admin id>",
            "identityProvider": "user",
            "tenantId": "<tenant Id>"
        }
    }
}'

Response

On success, the API returns

200 OK