This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# make a phone call to a given number, play a message and hangup. | |
# export CTM_API_KEY, CTM_API_SECRET and CTM_ENDPOINT you can get them from either /accounts/edit or /agencies/{id}/edit pages | |
# export CTM_ACCOUNT_ID=your account id | |
read -r -d '' request_body << request-json-body | |
{ | |
"call_number": "${TO_NUMBER}", | |
"from_number": "${FROM_NUMBER}", | |
"route": "hangup", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# using ctm forms api to manage creation, updates and destruction of forms | |
# as well as submitting data to the forms | |
# external to this script you should | |
# export CTM_API_KEY, CTM_API_SECRET and CTM_ENDPOINT you can get them from either /accounts/edit or /agencies/{id}/edit pages | |
# export CTM_ACCOUNT_ID=your account id | |
# form options include: | |
<< 'fields-avialable' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem "torchtext" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script async src="https://app.calltrackingmetrics.com/assets/ctm-phone-a4abb987e3ee84eea639cab343e2bfd5.js"></script> | |
</head> | |
<body> | |
<ctm-phone></ctm-phone> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import re | |
import websocket | |
import http.client as httplib | |
import base64 | |
import json | |
import urllib | |
import requests | |
from requests.auth import HTTPBasicAuth |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.handler = async function(event, context, callback) { | |
// https://api.calltrackingmetrics.com/api/v1/accounts/{{account_id}}/calls/{{id}}/tag?tag={{tag}} | |
const source_tag = event.activity.source_tag; | |
console.log("check for tag: ", source_tag); | |
if (source_tag && source_tag.length) { | |
console.log("apply source tag: ", source_tag) | |
await context.ctm.api_patch(`calls/${event.activity.id}/tag`, {"tag":source_tag}); | |
context.done(); | |
} else { | |
console.log("no source tag") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
{"lead_id":"TeSter-123-ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-0123456789-AaBbCcDdEeFfGgHhIiJjKkLl", | |
"user_column_data":[{"column_name":"Full Name","string_value":"FirstName LastName","column_id":"FULL_NAME"}, | |
{"column_name":"User Phone","string_value":"+16505550123","column_id":"PHONE_NUMBER"}, | |
{"column_name":"User Email","string_value":"[email protected]","column_id":"EMAIL"}, | |
{"column_name":"Company Name","string_value":"CompanyName","column_id":"COMPANY_NAME"}], | |
"api_version":"1.0","form_id":40000000000,"campaign_id":281489216452814, | |
"google_key":"----","is_test":true, | |
"gcl_id":"TeSter-123-ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-0123456789-AaBbCcDdEeFfGgHhIiJjKkLl", | |
"adgroup_id":20000000000,"creative_id":30000000000} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Consent Trackin With CTM</title> | |
<script async src="//51838.tctm.co/t.js"></script> | |
</head> | |
<body> | |
<h1>Call This Number (888) 888-8888</h1> | |
<p>If you consent to cookies and lots of tracking press this button <button id="pressed">Press me</button></p> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from hashlib import sha1; | |
import hmac; | |
import base64; | |
timestamp = '1350310273' # X-CTM-Time header | |
signature = 'A sample signature from CTM=' # X-CTM-Signature header | |
api_secret_key = 'your-api-key' # your secret key can be found in the account settings | |
msg = '{...}' # request body | |
mac = hmac.new(api_secret_key, timestamp, sha1) | |
mac.update(msg) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// wrapper around the customers ctm_action.js | |
const HTTPS = require('https'); | |
const URL = require('url'); | |
function http_request(opts, requestBodyCallback) { | |
let promise = new Promise(function(resolve, reject) { | |
let request = HTTPS.request(opts, function(response) { | |
let data = ""; | |
response.on('data', function (chunk) { data += chunk; }); | |
response.on('end', function () { resolve({request: request, response: response, responseBody: data}); }); |