CONTENT
  thinking about it, please hold on..

Touchpoints API

The Touchpoint API endpoints can be used to create, delete, update and read touchpoints on accounts in Totango.  

 

General restrictions and API limits

  • Like all APIs, there is a global rate limit of 1,000 calls/minute for each token.
  • Touchpoint length is limited to 3,000 characters

 

Your Authentication Keys

You will need your API key in order to access the API.

Login to Totango, click on your username (top-right corner of the page) and open your user profile. Your API Key is available under the INTEGRATION tab

 

Create a new Touchpoint

Create a new touchpoint by POSTing touchpoint data to: https://app.totango.com/api/v3/touchpoints/ . Post data should include the following:

 

{
  account_id: ‘0000’,  

  content: ‘This is the content of the touchpoint’, 

  activity_type_id:  ‘escalation’,  
  user_id: ‘avon@barksdale-industries.org’,
 create_date: 1461110400000
}

 

  • account_id: The account’s ID on Totango
  • content: The content of the touchpoint. Up to 3K characters
  • activity_type_id: *optional* The Successflow ID. You can get the ID of a SuccessFlow from the Totango Settings | SuccessFlow
  • create_date: *optional* The timestamp in unix time (EPOCH) miliseconds format. The touchpoint will  registered at this time. Example: 1461110400000

 

CURL 

curl --data 'account_id=0000&content=this+is+a+curl+test&activity_type_id=escalation&user_id=YOUR-TOTANGO-USER&create_date=1479081600000' --header 'app-token:YOUR-TOKEN-HERE' 'https://app.totango.com/api/v3/touchpoints/'

Javascript

const TOTANGO_TOKEN = 'PUT YOUR TOKEN HERE';
const TOTANGO_USER = 'PUT YOUR TOTANGO USER (email address) HERE';

// use: npm install request 
var request = require("request"); 

request.post("https://app.totango.com/api/v3/touchpoints/", {
    headers: {
			'app-token': token
		},
		form: {
		        account_id: '0000', // replace with an account_id on your system
                content: 'this is a test escalation',
                activity_type_id: 'escalation',
		        user_id: TOTANGO_USER,
		        create_date: Date.now() - (1000 * 60 * 60 * 48), 
        }
	}, (error, response, body) => {
            // handle success / failure ... 
            console.log(response.statusCode);
});

Note:

-- The  touchpoint will be created under the name of the user whose token was used to make the call.

 

Retrieving the list of Touchpoints

Touchpoints are stored as Events in an account’s timeline and can be retrieved using the /v2/events/ endpoint.

GET https://app.totango.com/api/v2/events/?account_id=<account_id> to retrieve all events registered on the timeline of account_id.


Returns a JSON array of events,  in the following format. Use the type property to distinguish between touchpoints (type=’note’), tasks (type=’task’) and other items.  

[

{
type: “note” 
id: “903d6e2bz70c2z359azb51czb7090410ea17”,
note_content": {
"text": "the content of the event",
"totango_user": {
"user_name": "user@email.com”
},
"note_id": 295830
},
"properties": {
"activity_type_id": "escalation"
}
}, 
{ … },
{ … }
]



NOTE: For brevity, we are only showing an event of type “note”, which is the internal name used for a touchpoint. Other event types include “task” and “alert”.

The text of the touchpoint is accessible in note_content.text. The user who authored the touchpoint is available under note_content.totango_user.user_name (email address as registered in Totango).

properties.activity_type_id contains the ID of the Successflow associated with this touchpoint.

Use note_content.note_id and id fields to delete the touchpoint (see below).

CURL

curl -X GET --header 'app-token:YOUR-TOKEN-HERE' 'https://app.totango.com/api/v2/events?account_id='

Javascript

'use strict'
// Available in your user profile on Totango
var TOTANGO_TOKEN = 'YOUR-TOKEN-HERE';


// use: npm install request 
var request = require("request"); 

var account_id = 000; // the account id you want the touchpoints for

request.get("https://app.totango.com/api/v2/events/?account_id=" + account_id, {
 headers: {
			'app-token': TOTANGO_TOKEN
		}
},
 function(error, response, body) {
            // handle success / failure ... 

        let results = JSON.parse(body);
        // filter touchpoints only (type === note)
        const touchpoints = results.filter((o) => o.type === "note"); 
        console.log(touchpoints);
});


Removing a Touchpoint

To remove a touchpoint from an account, use an HTTP DELETE command with the following structure

DELETE https://app.totango.com/api/v3/touchpoints/<note_id>

adding the event_id  in the post data


In order to delete a touchpoint, you need both its note_id and event_id, as retrieved from the list of events (see Retrieving the list of touchpoints, above). The note_id is used in the DELETE URL, and the event_id should be posted as data into the request.

CURL

curl -X DELETE  --data 'event_id=3963e754zccd4z3bd8zb563z0dd2d938ddbe' --header 'app-token:9fed6743602b8b38f1829a7f7140a86653b7ebc7superuser-totangomirror@totango.com' 'https://app.totango.com/api/v3/touchpoints/292920'

Javascript

// Available in your user profile on Totango
var TOTANGO_TOKEN = 'YOUR-TOTANG-TOKEN';


// use: npm install request 
var request = require("request"); 

// note_id and event_id should be retrieved from the account’s v2/events/ api
var note_id = ‘9999’;
var event_id = ‘6a8c7f9cz143fz3242zb0b2z3f8903f9740f’;

request.delete("https://app.totango.com/api/v3/touchpoints/" + note_id, {
 headers: {
			'app-token': TOTANGO_TOKEN
		},
 form: {
            event_id: event_id
        }
},
 function(error, response, body) {
            // handle success / failure ... 
        
        console.log(body);
});


Retrieving the list of SuccessFlow IDs

To set the SuccessFlow of a touchpoint, use the actvitiy_type_id field as shown above. In order to get the list of valid ID values, you can use the /api/v3/activity-types  endpoint.

GET https://app.totango.com/api/v3/activity-types

will return the following data structure:

{
   "renewal": {
      "activity_type_id": "renewal",
      "display_name": "Renewal",
      "num_of_activities_assign_to": 0,
      "icon_class": "icon-dollar",
      "system_type": true,
      "default_type": false,
      "disabled": false
},
   "support": {
      "activity_type_id": "support",
      "display_name": "Support",
      "num_of_activities_assign_to": 0,
      "icon_class": "icon-lifebouy",
      "system_type": true,
      "default_type": false,
      "disabled": false
}, 
   { ... }
}

xxx

Have more questions? Submit a request

Comments

Follow
Powered by Zendesk