Hello ,
var request = require('request');
function handleTokenCallback(body){
var options = {
url: 'Calling Roles API here**',
headers: {
'Authorization': body.token_type + " " + body.access_token
//console.log(body.token_type,body.access_token)
}
};
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
//console.log(JSON.stringify(JSON.parse(body), null, 2));
console.log('printing the JSON')
}else{
console.log('Printing Error: '+ error)
console.log(body.token_type + ' ' + body.access_token)
}
});
}
secret = process.env.purecloud_secret;
id = process.env.purecloud_client_id;
The above code working fine if I pass this Roles URL -
But, I dont get the JSON when I use this URL - "https://api.mypurecloud.de/api/v2/telephony/providers/edges"
Can you please help?
Regards,
Suresh