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.
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.
@sarfaraz_Mohammed Serverless app can only use account-level OAuth tokens. So, the app should be changed to account-level OAuth. The combination of agent-level OAuth for frontend and account-level OAuth for Serverless app is not possible.
Is there a requirement to have agent-level OAuth in your frontend app?
Thanks for your reply, yes we need to have an agent-level OAuth in frontend App.
This App will be used by Freshdesk agents.
Since a part of our requirement is to make Api calls to the third-party service provider during a ticket create or ticket update. We are inclined to use the Serverless product events as a trigger point.
@sarfaraz_Mohammed It’s not possible to use Agent OAuth in the Serverless component of the app. It’ll work only in the frontend.
Multiple OAuth mechanism in the same app is not supported. So, when frontend app uses agent-level OAuth, Serverless app has to use any other authorization such as API key way. It’s the only possible way in this case.