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:
POSTPath:
/sms/getEnterpriseSMSConfig/{enterpriseId}Required Fields
enterpriseIdSample 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:
POSTPath:
/sms/enableSMSServiceForUserRequest Body
{ "updatedBy": 12345, "userId": "user@example.com", "email": "user@example.com", "enterpriseId": 67890, "enable": true, "useCallingPhoneNumber": false, "callingPhoneNumber": 0, "userType": "BU", "userTag": "optional-tag" }Required Fields
enterpriseIduserIdSample 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": "user@example.com", "email": "user@example.com", "enterpriseId": 123, "enable": true, "useCallingPhoneNumber": false, "callingPhoneNumber": 0, "userType": "BU", "userTag": "optional-tag" }'API Response
Upon a successful request, the API returns.
200 OKAssign Phone Numbers to SMS User
API Endpoint
Method:
POSTPath:
/sms/addSMSDidsForUserRequest Body
{ "updatedBy": 12345, "enterpriseId": 67890, "userId": "user@example.com", "assigned": true, "smsDID": [ "125", "122" ] }Required Fields
enterpriseIduserIdsmsDIDarray - 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": "user@example.com", "assigned": true, "smsDID": [ "1261" ] }'API Response
Upon a successful request, the API returns
200 OK
Configure SMS Group
Create SMS Group
API Endpoint
Method:
POSTPath:
/sms/createSMSGroupRequest Body
{ "groupId": -1, "groupRef": null, "groupName": "groupName", "groupOwner": "owner@example.com", "enterpriseId": 67890, "enable": true, "deleteGroup": false, "groupNameOld": null }Required Fields
enterpriseIduserIdSample 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": "john.smith@democompany.com", "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": "john.smith@democompany.com", "enterpriseId": 78, "enterpriseRef": null, "app_sync": true, "enable": true, "dids": null, "members": null }Assign Phone Numbers to SMS Group
API Endpoint
Method:
POSTPath:
/sms/assignSMSDidsForGroupRequest Body
{ "assigned": true, "updatedBy": -1, "enterpriseId": 67890, "groupId": 54321, "groupRef": null, "groupName": "Sales Team Group", "groupOwner": "owner@example.com", "enterpriseRef": null, "smsDID": [ "123", "124" ] }Required Fields
enterpriseIdgroupIdsmsDIDarray - 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": "john.smith@example.com", "enterpriseRef": null, "smsDID": [ "1262", "1263" ] }'Required Fields
enterpriseIdgroupIdsmsDIDList (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 OKAdd Members to SMS Group
API Endpoint
Method:
POSTPath:
/sms/addSMSMembersForGroupRequest Body
{ "groupId": 54321, "enterpriseId": 67890, "smsMembers": [ "user1@example.com", "user2@example.com", "user3@example.com" ] }Required Fields
enterpriseIdsmsMembersgroupIdSample 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": [ "user1@example.com", "user2@example.com" ] }'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.