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: Enable SMS Service to the Enterprise
If this is a new Enterprise, create the Enterprise:
Follow the guide in Creating and Registering an Enterprise with Restricted Access, but be sure to pass to the services
field the value SMS instead and include other service the Enterprise will use (for example, “PBX”,”SMS”
).
If Enterprise is existing with other services enabled, add the SMS service to the Enterprise:
Edit the enterprise to add the SMS to the services
attribute.
See the API call details here: Common API Methods > Edit Enterprise.
Part II: Deploy Unified App to add the SMS Connetor
Sync Unified App
See the API call details here: Common API Methods > Sync Unified App.
You may also opt to execute this after configuring the SMS Users and SMS Groups as discussed in the next section.
Part III: Configure SMS Users and SMS Groups
Before You Begin
Before assigning phone numbers to SMS Users and SMS Groups, the phone numbers must be:
Assigned to the Enterprise. In other words, the phone numbers must be listed in the Enterprise > Phone Numbers page.
Configure with SMS Carrier Profiles assigned to carrier. In other words, at the Reseller > Phone Numbers page, the numbers must be managed with the SMS Carrier Profile having the right credentials for these numbers.
Get SMS Numbers under Enterprise
API Endpoint
Method:
POST
Path:
/sms/getEnterpriseSMSConfig/{enterpriseId}
Required Fields
enterpriseId
Sample cURL Request
curl --location --request POST 'https://api.connecttoteams.com/sms/getEnterpriseSMSConfig/{enterpriseId}' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <TOKEN>' \ --header 'Cookie: JSESSIONID=C3D94E7027631CE7F1C78F634A39B094'
API Response
Upon a successful request, the API returns
{ "enterpriseId": 78, "enabled": true, "dids": [ { "id": 123, "did": "1234567895", "assigned": true, "connected": true }, { "id": 456, "did": "1234567893", "assigned": true, "connected": true }, { "id": 489, "did": "1234567892", "assigned": false, "connected": true } ], "appSynced": false, "templatesEnabled": true }
Configure SMS User
Enable SMS for User
API Endpoint
Method:
POST
Path:
/sms/enableSMSServiceForUser
Request Body
{ "updatedBy": 12345, "userId": "[email protected]", "email": "[email protected]", "enterpriseId": 67890, "enable": true, "useCallingPhoneNumber": false, "callingPhoneNumber": 0, "userType": "BU", "userTag": "optional-tag" }
Required Fields
enterpriseId
userId
Sample cURL Request
curl --location --request POST 'https://api.connecttoteams.com/sms/enableSMSServiceForUser' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <TOKEN>' \ --header 'Cookie: JSESSIONID=7667909CB8748C9B1A1DDAE76C028A2E' \ --data-raw '{ "updatedBy": 12345, "userId": "[email protected]", "email": "[email protected]", "enterpriseId": 123, "enable": true, "useCallingPhoneNumber": false, "callingPhoneNumber": 0, "userType": "BU", "userTag": "optional-tag" }'
API Response
Upon a successful request, the API returns.
200 OK
Assign Phone Numbers to SMS User
API Endpoint
Method:
POST
Path:
/sms/addSMSDidsForUser
Request Body
{ "updatedBy": 12345, "enterpriseId": 67890, "userId": "[email protected]", "assigned": true, "smsDID": [ "125", "122" ] }
Required Fields
enterpriseId
userId
smsDID
array - The ids of the/sms/getEnterpriseSMSConfig/{enterpriseId}
discussed in Step 1 above.Sample cURL Request
curl --location --request POST 'https://api.connecttoteams.com/sms/addSMSDidsForUser' \ --header 'Authorization: Bearer <TOKEN>' \ --header 'Content-Type: application/json' \ --header 'Cookie: JSESSIONID=7667909CB8748C9B1A1DDAE76C028A2E' \ --data-raw '{ "updatedBy": 12345, "enterpriseId": 123, "userId": "[email protected]", "assigned": true, "smsDID": [ "1261" ] }'
API Response
Upon a successful request, the API returns
200 OK
Configure SMS Group
Create SMS Group
API Endpoint
Method:
POST
Path:
/sms/createSMSGroup
Request Body
{ "groupId": -1, "groupRef": null, "groupName": "groupName", "groupOwner": "[email protected]", "enterpriseId": 67890, "enable": true, "deleteGroup": false, "groupNameOld": null }
Required Fields
enterpriseId
userId
Sample cURL Request
curl --location --request POST 'https://api.connecttoteams.com/sms/createSMSGroup' \ --header 'Authorization: Bearer <TOKEN>' \ --header 'Content-Type: application/json' \ --header 'Cookie: JSESSIONID=7667909CB8748C9B1A1DDAE76C028A2E' \ --data-raw '{ "groupId": -1, "groupRef": null, "groupName": "Sales Group", "groupOwner": "[email protected]", "enterpriseId": 78, "enable": true, "deleteGroup": false, "groupNameOld": null }'
API Response
Upon a successful request, the API returns:
{ "groupId": 191, "groupRef": null, "groupName": "Sales Group", "groupOwner": "[email protected]", "enterpriseId": 78, "enterpriseRef": null, "app_sync": true, "enable": true, "dids": null, "members": null }
Assign Phone Numbers to SMS Group
API Endpoint
Method:
POST
Path:
/sms/assignSMSDidsForGroup
Request Body
{ "assigned": true, "updatedBy": -1, "enterpriseId": 67890, "groupId": 54321, "groupRef": null, "groupName": "Sales Team Group", "groupOwner": "[email protected]", "enterpriseRef": null, "smsDID": [ "123", "124" ] }
Required Fields
enterpriseId
groupId
smsDID
array - The ids of the/sms/getEnterpriseSMSConfig/{enterpriseId}
discussed in Step 1 above.Sample cURL Request
curl --location --request POST 'https://api.connecttoteams.com/sms/assignSMSDidsForGroup' \ --header 'Authorization: Bearer <TOKEN>' \ --header 'Content-Type: application/json' \ --header 'Cookie: JSESSIONID=7667909CB8748C9B1A1DDAE76C028A2E' \ --data-raw '{ "assigned": true, "updatedBy": -1, "enterpriseId": 78, "groupId": 192, "groupRef": null, "groupName": "myTestGroup1", "groupOwner": "[email protected]", "enterpriseRef": null, "smsDID": [ "1262", "1263" ] }'
Required Fields
enterpriseId
groupId
smsDID
List (Phone Number ID)Sample cURL Request
curl --location --request POST 'https://api.connecttoteams.com/sms/assignSMSDidsForGroup' \ --header 'Authorization: Bearer <TOKEN>' \ --header 'Content-Type: application/json' \ --header 'Cookie: JSESSIONID=7667909CB8748C9B1A1DDAE76C028A2E' \ --data-raw '{ "assigned": true, "updatedBy": -1, "enterpriseId": 78, "groupId": 192, "groupRef": null, "groupName": null, "groupOwner": null, "enterpriseRef": null, "smsDID": [ "1262", "1263" ] }'
API Response
Upon a successful request, the API returns
200 OK
Add Members to SMS Group
API Endpoint
Method:
POST
Path:
/sms/addSMSMembersForGroup
Request Body
{ "groupId": 54321, "enterpriseId": 67890, "smsMembers": [ "[email protected]", "[email protected]", "[email protected]" ] }
Required Fields
enterpriseId
smsMembers
groupId
Sample cURL Request
curl --location --request POST 'https://api.connecttoteams.com/sms/addSMSMembersForGroup' \ --header 'Authorization: Bearer <TOKEN>' \ --header 'Content-Type: application/json' \ --header 'Cookie: JSESSIONID=7667909CB8748C9B1A1DDAE76C028A2E' \ --data-raw '{ "groupId": 444192, "enterpriseId": 744448, "smsMembers": [ "[email protected]", "[email protected]" ] }'
API Response
Upon a successful request, the API returns
200 OK
Sync Unified App
See the API call details here: Common API Methods > Sync Unified App.
Note
For every change in SMS phone number assignment and updating members of the SMS group, the changes must be pushed to Teams by calling the Sync Unified App method.