09-01-2017 08:32 AM
Out of curiosity, why is there still no getLoginName() method for the finesse.restservices.User object? There is getExtension(), getFirstName() and getLastName() for the User object, and we can easily retrieve AgentID from Config.id (not well documented BTW), but there appears to be no method in the JS library to retrieve the agent's login name.
In absence of this function, what is the preferred/recommended method of retrieving the agent's Login Name information from within a Finesse gadget?
Are we supposed to use the AgentID from Config.id to call "Get User" from the REST API (http://<FQDN>/finesse/api/User/<id>) and parse the XML response to extract the loginName field? This seems like an odd and unnecessary approach to retrieving this data. Is there a better way?
Thanks,
NT
Solved! Go to Solution.
09-01-2017 10:44 AM
Hi,
To get the agent id, you can use user.getId().
You do bring up a good point that the login name isn't available. You can get any of the data from the User XML from the user data, so user.getData().loginName.
Thanx,
Denise
09-01-2017 10:44 AM
Hi,
To get the agent id, you can use user.getId().
You do bring up a good point that the login name isn't available. You can get any of the data from the User XML from the user data, so user.getData().loginName.
Thanx,
Denise
09-01-2017 10:51 AM
Thanks, Denise!
Out of curiosity, why are these functions not documented?
user.getId()
user.getData()
NT
09-01-2017 11:12 AM
They are documented, but its not as obvious:
Those methods are available for all of the objects that implement from RestBase (User, Dialog, Media, etc)
The Finesse team acknowledges that the JS doc is not the best and is working on figuring out a better solution.
Thanx,
Denise
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide