Hello Team,
Hope you guys are doing well
We are working on a third party integration with Freshdesk and using Agent level OAuth for authentication.
On successful authentication by the agent from ticket sidebar app we are able to fetch required data from third party service provider in front end.
Our application functionality is to POST data to third party service provider when a service task is created/updated in Freshdesk. Since this has to be an instantaneous process we have used OnTicketCreate and OnTicketUpdate product event.
But using the same API endpoint as used in Front end we are not able to POST data in Serverless product event.
onTicketUpdateCallback: function (payload) {
console.log("////// Ticket update product Event has been triggered ///////");
console.log(`-------- ${payload.data.ticket.id} ---------`);
var opt = {
headers: {
"Authorization": "bearer <%= access_token %>",
"Accept": "application/json",
"Content-Type": "application/json"
},
isOAuth: true
};
$request.get("https://graph.microsoft.com/v1.0/me/events?$select=subject,body,bodyPreview,organizer,attendees,start,end,location", opt).then(function (data) {
console.log(JSON.parse(data.response));
},function (error) {
console.log(error);
}): }
Kindly let me know if this is possible or is there any workaround available.
Thanks for you help
Sarfaraz