Created
March 15, 2013 00:59
-
-
Save Mistat/5166693 to your computer and use it in GitHub Desktop.
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
// Get AccessToken and AccessTokenSecret | |
app.get('/call', function(req, res) { | |
var accessToken = req.session.passport.user.token; | |
var accessTokenSecret = req.session.passport.user.tokenSecret; | |
// any code .... | |
} | |
// Example request | |
deskcom = new DeskcomStrategy(......); | |
deskcom._oauth.post( | |
'https://domain-name.desk.com/api/v1/interactions.json', | |
accessToken, | |
accessTokenSecret, | |
{interaction_channel:'phone', interaction_subject: 'call from tel:' + tel , customer_id:customer_id}, | |
"application/x-www-form-urlencoded", | |
function (err, body, response) { | |
if (err) { | |
return; | |
} | |
var data = JSON.parse(body); | |
var case_id = data.results.case.id; | |
// any code.... | |
} | |
); | |
deskcom._oauth.get( | |
'https://domain-name.desk.com/api/v1/customers.json?phone='+tel, | |
accessToken, | |
accessTokenSecret, | |
function (err, body, res) { | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment