Skip to content

Instantly share code, notes, and snippets.

@totango
totango / appbox curl
Created March 4, 2012 19:01
Appbox - create message curl
curl -v -d "receiver_id=jimmy@zeppelin.com&sender_name=Robert Plant&content=Hello World from Appbox&app_id=f6c93021a09dfbff7c8bd&secret=b1c2048a7592e05e1c9b6ac31b01590b85657a5c" http://www.appboxjs.com/api/v1/appbox/admin/new_message/
@totango
totango / totango111.js
Created March 4, 2012 16:12
totango111
// when the user successfully establishes a session (i.e. logs in)
totango.identify("account-id","username");
// When you want to track an event
totango.track("activity","module");
@totango
totango / create_message.html
Created March 2, 2012 10:08
New appbox message form
<h2>Send Message Form<small>Use the form below to send message</small></h2>
<!-- Put the message_editor just below -->
<form id="appbox_form" action='javascript:true;' method='post' class="well">
<fieldset>
<label>Receiver Name: </label><input type='text' name='receiver_name'>
<label>Receiver ID:</label><input type='text' name='receiver_id' value="test-user@email.com"'></input>
<label>Sender Name:</label><input type='text' name='sender_name'></input>
<label>Sender ID:</label><input type='text' name='sender_id'></input>
<label>Subject:</label><input type='text' name='subject'></input>
<label>Content:</label><textarea name='content'></textarea>
@totango
totango / appbox.html
Created February 27, 2012 23:18
appbox
<script>
var appbox_options = {
user_id : "user@yourapp.com", //todo: replace with user email/id
app_id : 123456, //todo: replace with app_id
};
(function() {
var ab = document.createElement('script'); ab.type = 'text/javascript'; ab.async = true;
ab.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'www.appboxjs.com/appbox.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ab, s);
})();
@totango
totango / totango999.js
Created February 19, 2012 15:38
totango-source-campaign example
<!-- Totango http call example -->
http://sdr.totango.com/pixel.gif/?sdr_s=SP-xxxx-xx&sdr_o=Acme&sdr_o.Source%Campaign=Value
@totango
totango / Totango4.js
Created February 19, 2012 15:35
totango-success-manager example
totango.identify(
{'id':'acme1234',
'Success Manager': 'Value'},"user");
@totango
totango / totangosm1.js
Created February 19, 2012 15:32
totango-sales-manager example
// HTTP call:
http://sdr.totango.com/pixel.gif/?sdr_s=SP-xxxx-xx&sdr_o=Acme&sdr_o.Sales%Manager=Value
@totango
totango / totango999.js
Created February 19, 2012 15:15
Totango - Javascript - updating account attributes
// identifying an account and setting attributes for it
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// totango.identify(account, user);
// params:
// - account: the account the user belongs to. possible values:
// - string: value is the account id
// - object:
// { 'o': 'account-id',
// 'attribute-name' : 'attribute-value', }
// - username: Name of the user of this session
@totango
totango / Totango67.js
Created December 28, 2011 15:41
Totango - Organization Display Name
totango.identify({
'id':'account-id',
'name': 'account display name'
},
'username');
@totango
totango / Totango66.js
Created December 28, 2011 15:24
Totango - Javascript Org Attributes
// Adding organization attributes to the identify method
totango.identify(
{o:'org-unique-id',
ofid:'id-on-salesforce',
odn: 'org-human-friendly-name'},
'USERNAME');
// Adding organization attributes to the track method
totango.track(
'activity',