Recent searches
No recent searches
Is there any way to get the logged user information through API?
Answered
Posted Apr 26, 2022
Hi, I want to get the logged user information on the ticket. I can't find this in the documentation
0
12
Recent searches
No recent searches
Posted Apr 26, 2022
Hi, I want to get the logged user information on the ticket. I can't find this in the documentation
0
12 comments
Eric Nelson
Are you looking for user info for the the requester who opened the ticket? If so, you can find this by sideloading the records.
Thanks!
0
Israr Ansari
Hey Eric Nelson
No, I am not looking for it. basically, I want to get the information of the login user or current user there is no API or method that fetches login user information
For Example
get_the_current_user() this method would return the id of the login user in WordPress through that we can fetch all the user information. So is there any way to do it in Zendesk?
Thanks!
0
Eric Nelson
Can you tell me more about your use case?
Thanks!
0
Israr Ansari
Hey Eric
Basically, I want to show some settings or configurations of my custom app on the ticket side but this setting is only visible for the admin not for the agent. So I want to develop a condition if the login user is an agent do something and if the login user is an admin show setting to him/her. That's why I want to get login user information. but unfortunately, I did not find something in the documentation that guide me on this. I hope you get my point if you have any questions about this then let me know.
Thanks!
0
Eric Nelson
Thanks for the additional info. You can use the currentUser method available for the Apps Framework to accomplish this.
zafClient.get('currentUser.role')
Hope this helps!
0
Israr Ansari
Hey Eric
Thanks! this works for me
0
Aleksandar Salevski
i get this error, ReferenceError: client is not defined
0
Aleksandar Salevski
Or i go this:
0
Greg Katechis
0
Aleksandar Salevski
0
Aleksandar Salevski
Any help here Greg Katechis?
0
Aleksandar Salevski
Guys any help on this one!
0