I created an application in freshservice which is integrate with the third party systems. Everything is working fine in that app. But i need to add new features in that app. They are,
- Add user scopes to make the app accessible only by selected persons.
- Add private note when a button clicked in an app.
How can i complete these tasks? Kindly share your suggestions.
Thanks in advance...
In the documentation you can see the payload that is associated with an Agent when you get the loggedInUser
Here is a screenshot of the payload retrieved for Agents when getting the LoggedInUser (which is only agents). Near the bottom there are group id’s that show the groups the agent is a member of.
This is not useful for getting requester information, just what agent is logged in.
The applications you build for freshservice are going to be agent facing. And if you want only certain Agents to be able to use the application, you can set up a condition that looks at the group_ids of the loggedInUser and if they qualify then allow the app to run. Hope this helps clarify my suggestions.
In reference to your second question. Yes you need an API key to validate the use of the freshservice APIs. Currently you could utilize username(email) and password but that is soon to be deprecated and only API keys will work. Be mindful of the api key you use. It must be associated with an Agent who has the necessary service desk permissions that match what you want to do with the API. In your case the api key must be for an agent who is capable of adding notes in the service desk through the UI, if you use that api key you will be able to add notes using the freshservice API.
Hope this helps,
@zachary.king Thanks for your reply. You mention about group association in your reply. I got the requester info when an app is initialized. But i don’t get any usergroups with that response. Can i get all the usergroups available in the freshservice instance and requester usergroups through API?
Also in my second case, I already did by using freshservice API key. Without freshservice API key, will app have any permission to add private notes?
Thanks in advance…
Unfortunately there is no way currently to install applications in freshservice and only make them available to certain agents. Once the application is installed and is configured to operate in one of the UI locations (ticket sidebar, full page app, new ticket side bar, etc.) it is accessible for all agents who access to those locations. A workaround for this is to add a conditional to your application’s code that would gain the loggedInUser, utilizing that you could limit application functionality. But there is no way to prevent the app from appearing, you just can prevent the app from working if the loggedInUser doesn’t meet your criteria (agent role, group association, etc)
For your second question regarding adding a private note. You can do this inside the application utilizing the request method and the freshservice API. Information for both are found here https://developers.freshservice.com/.
Hope this helps,