Unable to make API request in Serverless product event after agent level OAuth

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

HI @sarfaraz_Mohammed,

Developers can’t invoke this onTicketUpdateCallback function. This will be called internally when our platform receives events from freshDesk.

Are you calling this onTicketUpdateCallback function from frontend using SMI? correct me if i am wrong.

Hi @Gopinath_Radhakrishn,
Thanks for you response,

As you said onTicketUpdateCallback is getting evoked when a ticket is updated in Freshdesk and i am using this callback function to update the third party service provider.
But the API request i am making fails with the following Error

{ status: 400, response: '{"error":"invalid_request","error_description":"AADSTS900144: The request body must contain the following parameter: \'refresh_token }`

To answer you question i am not using SMI call in this case.

exports = {
  events: [
    { event: 'onTicketCreate', callback: 'onTicketCreateHandler' },
    { event: "onTicketUpdate", callback: "onTicketUpdateCallback" },
  ],
}