Skip to content

Instantly share code, notes, and snippets.

@Aayush-N
Created July 19, 2018 12:42
Show Gist options
  • Save Aayush-N/cea8982aee3b8cf24665baefa80e7348 to your computer and use it in GitHub Desktop.
Save Aayush-N/cea8982aee3b8cf24665baefa80e7348 to your computer and use it in GitHub Desktop.
var jwt = require('jsonwebtoken');
var request = require('request');
var token = jwt.sign(
{
jti: "d8661a14-4b7c-5fda-2227-9b055fcf5b10",
iss: "API KEY",
sub: "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
exp: Math.floor(Date.now() / 1000) + (60 * 10)
}
, 'API SECRET');
var options = {
url: 'https://interviews.skype.com/api/interviews',
headers: {
'Authorization': 'Bearer ' + token
},
json: {
"code": "RENE2010",
"title": ".Net Developer Interview"
}
};
request.post(options , function (error, response, body) {
console.log('error:', error);
console.log('statusCode:', response && response.statusCode);
console.log('body:', body);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment