cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1542
Views
6
Helpful
3
Replies

Finesse JS Library Get Login Name?

nikthoman
Level 5
Level 5

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

1 Accepted Solution

Accepted Solutions

dekwan
Cisco Employee
Cisco Employee

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

View solution in original post

3 Replies 3

dekwan
Cisco Employee
Cisco Employee

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

Thanks, Denise!

Out of curiosity, why are these functions not documented?

user.getId()

user.getData()

NT

They are documented, but its not as obvious:

doc.png

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