cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4272
Views
15
Helpful
11
Replies

UCCX: How to assign a skill to an agent?

Oliver Henning
Level 1
Level 1

Hi there,

 

in the UCCX_API Developer Guide I did not find a method how to assign a skill to an agent. How is this done?

 

Sincerely,

Oliver Henning

11 Replies 11

in UCCX skills are assigned in multiple ways using skill and de skill tool or in management portal where you create queues and skills you can add agents.  You may want to search adding skills to agents or adding agents to a skill.

 

Good luck.

Baseer.

Chris Deren
Hall of Fame
Hall of Fame

You might be better served posting your questions here:

https://communities.cisco.com/community/developer/express-configuration-api

 

Mark Grace
Level 1
Level 1

Agent skilling was added for CCX 9.0(2), along with other Agent configuration, CSQs, Teams, & Applications (10.0 added Trigger support).

What version of CCX are you running and which version of the doc are you viewing?

Richard Simmons
Level 3
Level 3

Hi Oliver,

I'm looking into this myself at the moment and can add skills to individual users at a time, still trying to work out how to do it in bulk.

I did the following from the Advanced REST API plugin from Chrome.

Get a list of resources;

http://UCCXSERVER/adminapi/resource - (you will need to log in with the App Admin Account)

copy the text and put into a text editor

Get a list of skills;

http://UCCXSERVER/adminapi/skills

copy the text and put into a text editor

Find the user you want to add the skill too e.g.

<resource>
<self>http://UCCXSERVER/adminapi/resource/rsimmons</self>
<userID>rsimmons</userID>
<firstName>Simmons</firstName>
<lastName>Richard</lastName>
<extension>+44000001000</extension>
<skillMap />
<autoAvailable>true</autoAvailable>
<type>1</type>
<team name="Support Team">
<refURL>http://UCCXSERVER/adminapi/team/1</refURL>
</team>
<primarySupervisorOf />
<secondarySupervisorOf />
</resource>

Find the skill you want to add to them e.g.

<skill>
<self>http://CCXSERVER/adminapi/skill/1</self>
<skillId>1</skillId>
<skillName>Support</skillName>
</skill>

Now you need to add this to the resource - note the additional of the alias and the information under skillMap

<resource>
<self>http://UCCXSERVER/adminapi/resource/rsimmons</self>
<userID>rsimmons</userID>
<firstName>Simmons</firstName>
<lastName>Richard</lastName>
<extension>+44000001000</extension>
<alias />
<skillMap>
<skillCompetency>
<competencelevel>7</competencelevel>
<skillNameUriPair name="Support">
<refURL>http://UCCXSERVER/adminapi/skill/1</refURL>
</skillNameUriPair>
</skillCompetency>
</skillMap>
<autoAvailable>true</autoAvailable>
<type>1</type>
<team name="Support Team">
<refURL>http://UCCXSERVER/adminapi/team/1</refURL>
</team>
<primarySupervisorOf />
<secondarySupervisorOf />
</resource>

Change the address within the REST API plugin to the user

http://UCCXSERVER/adminapi/resource/rsimmons

Set the method to PUT

Paste in the above with the xml file info into the payload

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource>
<self>http://UCCXSERVER/adminapi/resource/rsimmons</self>
<userID>rsimmons</userID>
<firstName>Simmons</firstName>
<lastName>Richard</lastName>
<extension>+44000001000</extension>
<alias />
<skillMap>
<skillCompetency>
<competencelevel>7</competencelevel>
<skillNameUriPair name="Support">
<refURL>http://UCCXSERVER/adminapi/skill/1</refURL>
</skillNameUriPair>
</skillCompetency>
</skillMap>
<autoAvailable>true</autoAvailable>
<type>1</type>
<team name="Support Team">
<refURL>http://UCCXSERVER/adminapi/team/1</refURL>
</team>
<primarySupervisorOf />
<secondarySupervisorOf />
</resource>

Change the content type to application/xml and press send.

I am able to add skills to individual users this way but am now looking at how to do this for multiple users.

Hope this helps,

Richard

George Paxson
Level 1
Level 1

I figure there has been a long time.  This has been answered?  I just coble together some Python.

George Paxson
Level 1
Level 1

import StringIO
import requests
from optparse import OptionParser

ip,user,pwd = 'someserver','admin','cisco'


def update_user(var1, var2, var3, var4, var5):


xmlTemplate1 = """<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource>
<self>https://someserver/adminapi/resource/%(my_userid)s</self>
<userID>%(my_userid)s</userID>
<firstName>%(my_firstname)s</firstName>
<lastName>%(my_lastname)s</lastName>
<extension>%(my_extension)s</extension>
<alias/>
<skillMap>
<skillCompetency>
<competencelevel>%(my_skill_level)s</competencelevel>
<skillNameUriPair name="Service Desk">
<refURL>https://someserver/adminapi/skill/17</refURL>
</skillNameUriPair>
</skillCompetency>
</skillMap>
<autoAvailable>true</autoAvailable>
<type>2</type>
<team name="The A Team">
<refURL>https://someserver/adminapi/team/6</refURL>
</team>
<primarySupervisorOf/>
<secondarySupervisorOf>
<supervisorOfTeamName name="The A Team">
<refURL>https://someserver/adminapi/team/6</refURL>
</supervisorOfTeamName>
</secondarySupervisorOf>
</resource>"""
data = {'my_userid':var1, 'my_firstname':var2, 'my_lastname':var3, 'my_extension':var4, 'my_skill_level':var5}
xml = xmlTemplate1%data
axl_call(xml, var1)


def axl_call(data, userid):


header ={'content-type': 'application/xml'}
url = 'https://someserver/adminapi/resource/' + userid
r = requests.put(url,headers=header,data=data,verify=False,auth=(user,pwd))
if (r.status_code == requests.codes.ok):
print str(r.status_code) + ' OK'
else:
print '****************************'
print 'YOU MADE A MISTAKE SOMEWHERE'
print r
return

 

my_dict = {
'john.doe':['John', 'Doe', '80013437', '7'],
'jane.doe':['Jane', 'Doe', '80015608', '7'],
}

 

def main():

 

for item in my_dict:

 

print(item)
update_user(item, my_dict[item][0], my_dict[item][1], my_dict[item][2], my_dict[item][3])


if __name__ == '__main__':

 

main()

 

 

mparra.fusionet
Level 1
Level 1

Guys here's an updated one in python 3.12 working on UCCX 12.5 , the original was done on python 2, this can be improved further, but for most quick and dirty bulking of Skills in UCCX it will do the trick. Thank you to @George Paxson for doing the original one, it was helpful to me


import requests

ip, user, pwd = '<hostname>', '<adminusername>', '<password>'


def update_user(var1, var2, var3, var4, var5
my_userid= var1
my_firstname = var2
my_lastname= var3
my_extension = var4
my_skill_level = var5

xml = (f'<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>\n' +
'<resource>\n'+ f'<self>https://{ip}/adminapi/resource/{my_userid}</self>\n' +
f'<userID>{my_userid}</userID>\n' +
f'<firstName>{my_firstname}</firstName>\n' +
f'<lastName>{my_lastname}</lastName>\n' +
f'<extension>{my_extension}</extension>' +
'<alias/>\n' +
'<skillMap>\n' +
'<skillCompetency>\n' +
f'<competencelevel>{my_skill_level}</competencelevel>\n' +
'<skillNameUriPair name="<NAMEOFSKILL>">\n' +
f'<refURL>https://{ip}/adminapi/skill/116</refURL>\n' +
#user ID 116 is obtained when doing a get to https://<uccx>/adminapi/resource/<userlogin>, from a user that is configured with the intended final configuration
'</skillNameUriPair>\n' +
'</skillCompetency>\n' +
'</skillMap>\n' +
'<autoAvailable>true</autoAvailable>\n' +
'<type>1</type>\n' +
'<team name="<NAMEOFTEAM>">\n' +
f'<refURL>https://{ip}/adminapi/team/20</refURL>\n' +
#team ID 20 is obtained when doing a get to https://<uccx>/adminapi/resource/<userlogin>, from a user that is configured with the intended final configuration

'</team>\n' +
'<primarySupervisorOf/>\n' +
'<secondarySupervisorOf/>\n' +
'</resource>')
axl_call(xml, var1)


def axl_call(data, userid
header = {'content-type': 'application/xml'}
url = f'https://{ip}/adminapi/resource/' + userid
r = requests.put(url, headers=header, data=data, verify=False, auth=(user, pwd))
if (r.status_code == requests.codes.ok):
print (str(r.status_code) + ' OK')
else:
print('****************************')
print('YOU MADE A MISTAKE SOMEWHERE')
print (f'{r}')
return

my_dict = {
'user1': ['userfirstname1', 'userlastname1', '1000', '10'], #10 as proficiency for skill hardcoded in the xml file
'user2': ['userfirstname2', 'userlastname2', '1001', '10'], #10 as proficiency for skill hardcoded in the xml file
}


def main():
for item in my_dict:
print(item)
update_user(item, my_dict[item][0], my_dict[item][1], my_dict[item][2], my_dict[item][3])

if __name__ == '__main__':
main()

mparra.fusionet
Level 1
Level 1

Guys here is an updated version for python 3.12, it is working on UCCX 12.5 admin API.  Thank you to @George Paxson  for providing the originial one for python 2, this was incredibly useful to me!

 

import requests

ip, user, pwd = '<hostname>', '<adminusername>', '<password>'


def update_user(var1, var2, var3, var4, var5
my_userid= var1
my_firstname = var2
my_lastname= var3
my_extension = var4
my_skill_level = var5

xml = (f'<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>\n' +
'<resource>\n'+ f'<self>https://{ip}/adminapi/resource/{my_userid}</self>\n' +
f'<userID>{my_userid}</userID>\n' +
f'<firstName>{my_firstname}</firstName>\n' +
f'<lastName>{my_lastname}</lastName>\n' +
f'<extension>{my_extension}</extension>' +
'<alias/>\n' +
'<skillMap>\n' +
'<skillCompetency>\n' +
f'<competencelevel>{my_skill_level}</competencelevel>\n' +
'<skillNameUriPair name="<NAMEOFSKILL>">\n' +
f'<refURL>https://{ip}/adminapi/skill/116</refURL>\n' +
#user ID 116 is obtained when doing a get to https://<uccx>/adminapi/resource/<userlogin>, from a user that is configured with the intended final configuration
'</skillNameUriPair>\n' +
'</skillCompetency>\n' +
'</skillMap>\n' +
'<autoAvailable>true</autoAvailable>\n' +
'<type>1</type>\n' +
'<team name="<NAMEOFTEAM>">\n' +
f'<refURL>https://{ip}/adminapi/team/20</refURL>\n' +
#team ID 20 is obtained when doing a get to https://<uccx>/adminapi/resource/<userlogin>, from a user that is configured with the intended final configuration

'</team>\n' +
'<primarySupervisorOf/>\n' +
'<secondarySupervisorOf/>\n' +
'</resource>')
axl_call(xml, var1)


def axl_call(data, userid
header = {'content-type': 'application/xml'}
url = f'https://{ip}/adminapi/resource/' + userid
r = requests.put(url, headers=header, data=data, verify=False, auth=(user, pwd))
if (r.status_code == requests.codes.ok):
print (str(r.status_code) + ' OK')
else:
print('****************************')
print('YOU MADE A MISTAKE SOMEWHERE')
print (f'{r}')
return

my_dict = {
'user1': ['userfirstname1', 'userlastname1', '1000', '10'], #10 as proficiency for skill hardcoded in the xml file
'user2': ['userfirstname2', 'userlastname2', '1001', '10'], #10 as proficiency for skill hardcoded in the xml file
}


def main():
for item in my_dict:
print(item)
update_user(item, my_dict[item][0], my_dict[item][1], my_dict[item][2], my_dict[item][3])

if __name__ == '__main__':
main()

Glad it has been helpful.  Thanks for the update.  My call center is not so large and most agents are technical in the mechanical services and engineering field.  Agents have the permissions to update themselves as they know their schedule and availability needs.  I have used the SOAP AXL interface much more frequently with CUCM in system migrations, consolidations.  I recommend looking into jinja templates to simplify the xml to post and loading agent information from a yaml file.  Boiler plate stuff for any SOAP AXL script.

George Paxson
Level 1
Level 1

like so...

Thank you @George Paxson !

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: