RBA Cash Rate: 4.35% · 1AUD = 0.67 USD · Inflation: 4.1%  
Leading Digital Marketing Experts | 1300 235 433 | Aggregation Enquires Welcome | Book Appointment
Example Interest Rates: Home Loan Variable: 5.38% (6.14%*) • Home Loan Fixed: 5.44% (6.26%*) • Fixed: 5.44% (6.26%*) • Variable: 5.38% (6.14%*) • Investment IO: 5.69% (6.52%*) • Investment PI: 5.49% (5.98%*)

Using SalesTrekker Webhooks to Perform Broker Tasks

Using SalesTrekker Webhooks to Perform Broker Tasks

We deal with just about every aggregator software platform in some way or another. Most are generic platforms altered to provide the appearance of a mortgage broker tool when it does little to improve upon the broker's daily workflows. Most don't provide much automation and very few have the features necessary to facilitate growth. This isn't to say that these systems aren't 'adequate' (some of them are quite good), but the first platform we have identified in the marketplace that provides a suite of features we'd consider excellent is SalesTrekker ... and while we deal with anything and everything, ST has become a platform we've become to enjoy dealing with more than others.

Far too often we'll talk to brokers that are highly committed to their software choice (and the software is usually a mitigating factor in the choice of aggregator, or it plays a part in the decision to move to another aggregator). This commitment to what is occasionally flawed software is usually supported by a choice-supportive or anchoring bias simply because the broker simply isn't aware of what features their competition has access to, or how these features and tools are helping others grow their business.

While SalesTrekker doesn't support everything we want it to (and likely never will) they provide webhooks that notify our Platform when a specific task is completed. When the ST system doesn't support a business-specific type of automation we're able to use these notifications to action the necessary task on our end. We've integrated the system with Office365/Exchange so it's tightly aligned with features available within various Office tools - such as tasks, email, calendar, and OneDrive (cloud storage). This integration ensures any actions on our end outwardly appear as they're seamlessly integrated with internal broker business systems.

This quick article simply provides a very basic introduction to how the webhook system works, and how one might record an action and then assign a specific server-side task. The actions that you'll perform as a result of webhooks can be anything that floats your boat.

Setting up Webhooks

An administrator can set up webhooks via the API menu. For those that work with us, a single endpoint is required on our Platform for all webhook fields. Again, if you're working with us, we'll need to know your API key so we can authenticate your ST requests against our own database. To reveal your API key you'll need to click the "Reveal API Key" button. The API key is assigned full administrative privileges so should be kept secret.

SalesTrekker Webhooks API

SalesTrekker Settings Menu

Incoming SalesTrekker Data

When SalesTrekker submits data to your webhook endpoint they'll include the user's API Key in the header for authorisation purposes. We'll need to retrieve the key and compare it against our own database for authentication, but also so we're able to assign the specific action to the correct user.

1
<?php 
2
/*
3
 Get SalesTrekker Authorisation Key
4
 https://www.beliefmedia.com.au/salestrekker-webhooks
5
*/
6
 
7
function beliefmedia_salestrekker_api_auth() {
8
 
9
  $headers = apache_request_headers();
10
  if ($headers === false || !is_array($headers)) return false;
11
  $key = trim(str_replace('Salestrekker', '', $headers['Authorization']));
12
 
13
  /* Perform DB request here and return the appropriate user and key, else return false */
14
 
15
 return $key;
16
}

The authentication function should check the user against your database, determine the authenticity of the request, and if the user exists our function should return an array of appropriate authentication data (rather than just the key string as shown above for illustrative purposes).

In some Apache builds they'll remove the key from the header as a security precaution. If this applies to you, add the following to your .htaccess file:

1
SetEnvIf Authorization &quot;(.*)&quot; HTTP_AUTHORIZATION=$1

In some cases the following directive may work:

1
CGIPassAuth on

You may also want to check that the event posted to your endpoint is valid, or that you're able to process the endpoint in question (either way, you should create a log of incoming requests). An example function is shown below.

1
<?php 
2
/* Is Valid Event? */
3
$array = beliefmedia_salestrekker_webhooks();
4
if (!array_key_exists($event, $array)) exit;
5
 
6
/*
7
 SalesTrekker Webhooks Array
8
*/
9
 
10
function beliefmedia_salestrekker_webhooks() {
11
 
12
  $array = array(
13
 'contactCreated' => 'Contact Created',
14
 'contactUpdated' => 'Contact Updated',
15
 'dealCreated' => 'Deal Created',
16
 'dealUpdated' => 'Deal Updated',
17
 'dealChangesDueDate' => 'Deal Changes Due Date',
18
 'dealChangesStage' => 'Deal Changes Stage',
19
 'dealChangesWorkflow' => 'Deal Changes Workflow',
20
 'dealChangesStatus' => 'Deal Changes Status',
21
 'dealChangesAttachments' => 'Deal Changes Attachments',
22
 'dealChangesRequiredDocuments' => 'Deal Changes Required Documents',
23
 'dealChangesOwner' => 'Deal Changes Owner',
24
 'noteCreated' => 'Note Created',
25
 'noteUpdated' => 'Note Updated'
26
  );
27
 
28
 return $array;
29
}

For the sake of our 'working' example we'll just write the SalesTrekker data to a text file. In reality, obviously, we'll use the supplied information to query ST for changes before actioning the appropriate task on our end.

1
<?php 
2
/* Get content */
3
$data = file_get_contents('php://input');
4
$data = json_decode($data, true);
5
if ($data === false || !is_array($data)) exit;
6
 
7
/* Type of request */
8
$event = $data['event'];
9
 
10
/* Now perform action */
11
switch ($event) {
12
 
13
    case 'contactCreated':
14
        file_put_contents('contactCreated.txt', file_get_contents('php://input'));
15
        break;
16
 
17
    case 'contactUpdated':
18
        file_put_contents('contactUpdated.txt', file_get_contents('php://input'));
19
        break;
20
 
21
    case 'dealCreated':
22
        file_put_contents('dealCreated.txt', file_get_contents('php://input'));
23
        break;
24
 
25
    case 'dealUpdated':
26
        file_put_contents('dealUpdated.txt', file_get_contents('php://input'));
27
        break;
28
 
29
    case 'dealChangesDueDate':
30
        file_put_contents('dealChangesDueDate.txt', file_get_contents('php://input'));
31
        break;
32
 
33
    case 'dealChangesStage':
34
        file_put_contents('dealChangesStage.txt', file_get_contents('php://input'));
35
        break;
36
 
37
    case 'dealChangesWorkflow':
38
        file_put_contents('dealChangesWorkflow.txt', file_get_contents('php://input'));
39
        break;
40
 
41
    case 'dealChangesStatus':
42
        file_put_contents('dealChangesStatus.txt', file_get_contents('php://input'));
43
        break;
44
 
45
    case 'dealChangesAttachments':
46
        file_put_contents('dealChangesAttachments.txt', file_get_contents('php://input'));
47
        break;
48
 
49
    case 'dealChangesRequiredDocuments':
50
        file_put_contents('dealChangesRequiredDocuments.txt', file_get_contents('php://input'));
51
        break;
52
 
53
    case 'dealChangesOwner':
54
        file_put_contents('dealChangesOwner.txt', file_get_contents('php://input'));
55
        break;
56
 
57
    case 'noteCreated':
58
        file_put_contents('noteCreated.txt', file_get_contents('php://input'));
59
        break;
60
 
61
    case 'noteUpdated':
62
        file_put_contents('noteUpdated.txt', file_get_contents('php://input'));
63
        break;
64
}

If you're a techy type of broker you can include the code above into a PHP file and see how the system works (there's no security so ensure it's not a readily accessible URL). A number of user-defined rules should exist for each action that are performed server-side when any notified event takes place.

SalesTrekker Data Types

Each event type submitted by SalesTrekker includes certain fields. In most cases, an Event type and ID will be returned. The only exception we've identified thus far is when a note is created.

Typical Response

1
array (
2
  'event' => '{the-event-type}',
3
  'id' => 'b1ed4f8a-xxxx-48fd-xxxx-ff8d7df2d437',
4
)

Note Created

1
array (
2
  'event' => 'noteCreated',
3
  'idDeal' => 'b9889e50-xxxx-xxxx-a3a3-8af8c9858b54',
4
  'id' => '49aac40f-xxxx-xxxx-xxxx-98d640acfe24',
5
)

You may then perform a request against SalesTrekker's GraphQL API and return the appropriate data before performing any necessary server-side actions.

BM Integration

True automation cannot be achieved until double data-entry is eliminated, fact-finding forms, compliance questionnaires, and file upload features (among other features) are all tightly sewn together and operate without unnecessary human interaction. We believe in automating everything that can be automated. While our competition leans towards the automation sales pitch as a means to elevate the significance of their product, they're usually deceiving their audience by talking about the super-simple plug-and-play automation relating to simple tasks such as email.

Until early 2019 we had a module that performed about every function available via the ST API... and then SalesTrekkker changed their API without notice and fully depreciated their Version 1 endpoint. After a few days of mourning the loss of months' work we're now in the process of rebuilding our former products. That said, there are still basic functions that we currently support. When SalesTrekker is selected as your aggregator via our plugin we'll return a page of options that details basic CRM integration.

BeliefMedia SalesTrekker Options

BeliefMedia's SalesTrekker Options

While not yet fully operational (again, as a result of SalesTrekker disabling their former API without any notification), we have a number of defined actions that can be actioned on the basis of certain workflow or other changes on the SalesTrekker platform.

We try to integrate and automate our users against every CRM platform - not just SalesTrekker.

Conclusion

SalesTrekker is implementing a number of features into the software due early in the second quarter of 2019 - the most notable feature is the inclusion of a tool that'll read incoming emails and associated the communication with a defined user. As a result, some of the functionality we formerly provided will not be replicated on the GraphQL API. However, we'll build broker features that SalesTrekker doesn't provide in addition to features that are specific to individual businesses. The webhook functionality goes a long way in which to achieve these outcomes.

Webhooks are not unique to SalesTrekker. In fact, at the time of writing we're building a module that closely integrates with features of Microsoft's Graph Webhooks to provide a new raft of automated tools.

■ ■ ■

 
Download our complimentary 650-page guide on marketing for mortgage brokers. We'll show you exactly how we generate billions in volume for our clients.
Finance Guide, Cropped Top and Bottom
  Timezone: 1 · [ CHANGE ]

RELATED READING

Like this article?

Share on Facebook
Share on Twitter
Share on Linkdin
Share on Pinterest

Leave a comment