1. Knowledge Base
  2. Application How To

New Tenstreet webhook Setup in CFA

Here are the steps to set up the webhooks in CFA.

1. Navigate to the specific Group you need the webhook set up.

2. Navigate to Settings , Customization and then Webhooks. 

Set up the fields as follows - 

Webhook Name - Tenstreet 

Description - This is a Tenstreet Webhook Setup

Endpoint URL - https://api.tenstreet.com

Method - Post

Format - JSON 

Post Call only options - Include Data Append

3. Set up the Static Parameters as follows -  These fields are mandatory and will be common for all the Groups/Companies. 

clientId: 151

Password: Ybuw42vax2*1rjB97R^lXjt

Service: ts_active_calls

customPayload:    10001

This Completes your Webhook Setup for a specific group.

4. Navigate to Groups and users under the same Company you set up the Webhooks for,

Set up the Call value (Tenstreet Id) as a Template. Make sure you hit the save button when you set up the call value at group level.  This will make it very easy when you will navigate to the tracking numbers. The same  call value will populate automatically at the tracking number level and you will have to hit save at tracking number level as well. 

5. Navigate to Every Tracking Line of that specific group and hit save , Your call value (tenstreet Id ) will be saved. 

6. Navigate to Call Actions under the same Group. For Instance KKW 

Here you will set up the call actions so that the same actions populate at tracking number level as well. 

Condition is - 

If duration > 0 

Trigger the Webhook Tenstreet

7. For Call Actions to be set up at Tracking Number level, You just need to hit the save button since they will already be set up at subgroup level. Make sure you hit that save button at the bottom on the tracking number level. 

 Steps for Quality Check-

1. Pull Campaign Export to ensure the call value is correct.
2. Use the below queries to ensure call actions are applied correctly on all the tracking lines and are saved in our DB
select * from call_action as ca join call_action_rule as car on car.action_id = ca.action_id join webhook as w on w.webhook_id::text = ca.action_target join provisioned_route as pr on pr.provisioned_route_id = ca.provisioned_route_id join org_unit as ou on ou.org_unit_id = pr.provisioned_route_ou_id where ca.provisioned_route_id in ( select provisioned_route_id from provisioned_route where provisioned_route_ou_id in (175263) and provisioned_route_status != 'deleted' )
SELECT ca.action_id, ccf.dnis AS Tracking_Number, ccf.default_ringto, ca.provisioned_route_id, ca.action_order, car.data_field, car.operator, car.comparator, ACTION , ca.action_target, car.join_type, ou.org_unit_name AS group_name FROM call_action_rule car JOIN call_action ca ON car.action_id= ca.action_id JOIN ce_call_flows ccf ON ca.provisioned_route_id= ccf.provisioned_route_id JOIN org_unit ou ON ccf.ouid=ou.org_unit_id JOIN provisioned_route_number prn ON prn.provisioned_route_id= ccf.provisioned_route_id JOIN provisioned_route pr ON pr.provisioned_route_id=prn.provisioned_route_id WHERE ou.top_ou_id=74733
3. Place a Test Call  and to ensure that the webhooks are firing up we receive an accepted response from tenstreet which is currently monitored by Randy but we are working on the process where we can track this on our end. 
Example of Accepted Response from Tenstreet as per the new script - 
{ ClientId: '151',
     Password: 'Ybuw42vax2*1rjB97R^lXjt',
     Service: 'ts_active_calls' },
  CompanyId: 47704,
  CompanyName: 'LCL Bulk Elkhorn',
  CompanyContactName: 'LCL Bulk  Elkhorn',
  CompanyContactEmail: '',
   { CallerIdName: ' ',
     CallerIdPhone: '385-279-5543',
     Municipality: 'Ogden',
     Region: 'UT',
     PostalCode: '84404' },
  NumberDialed: '888-266-5970',
  CallDateTime: '2021-10-13 21:22:19',
  Duration: 45 }
BODY: <?xml version="1.0" encoding="UTF-8"?>
 <Description>Call Data Received. Transaction id #8340827</Description>