09-26-2023 10:36 PM
How can we achieve automation for onboarding process or day-to-day activities in the PCCE and UCCE using AXL/API? i have used WSDL/AXL request for CUCM automation, so i am looking for something like that.
Solved! Go to Solution.
09-27-2023 01:29 AM
Hey
For the PCCE/UCCE you have to use the REST api
PCCE Overview - Packaged Contact Center Enterprise - Document - Cisco Developer
For adding new agents :
Agent Call API - Packaged Contact Center Enterprise - Document - Cisco Developer
12-08-2023 06:28 AM
If you are updating then the method must be PUT. The URL for the PUT is the server destination plus the refURL for the agent in the GET response. An insert would a POST. It has been a couple years since I wrote my script, so it is a little murky. I do have a vague recollection of not being able to update certain things. Sorry that isn't more specific. My suggestion would be to only include the items you are changing in your update XML. You will decrease the footprint of what you have to troubleshoot.
09-27-2023 01:29 AM
Hey
For the PCCE/UCCE you have to use the REST api
PCCE Overview - Packaged Contact Center Enterprise - Document - Cisco Developer
For adding new agents :
Agent Call API - Packaged Contact Center Enterprise - Document - Cisco Developer
09-29-2023 11:05 AM
Thanks a lot Thomas, i will have a look into these and will post my status in few days. However i am sure that you have directed me the correct direction
12-05-2023 03:44 AM
hi Thomas, now i have completed the script which can pull user data or PCCE configurations, however i have query on two things here. 1) if i have to query the PCCE AW for a specific agent using his AgentID, is that possible ? because in PCCE unless we do SQL query we will not have the 4 digit reference ID for the agent. 2) If we have to do POST request how can we have the XML file ? or if we use json, how to identify the user here?
thanks again in advance
12-05-2023 07:44 AM
Hey
In the get statement for agent the url is
<server>/unifiedconfig/config/agent/<id>.
or you can make an search with
<server>/unifiedconfig/config/agent?agentId=<agentId>
for the post the xml is a part of your body in the request (not a file, but the xml itself)
12-06-2023 09:33 AM
hi Thomas,
hope you are having a wonderful day
Yes i am able to do the get using the url you have mentioned above. however in generals we may not have the ID to use in <server>/unifiedconfig/config/agent/<id> handy and it is not easy in the script (at least what i felt). Yes i tried using agent?agentId=<agentId> , this pulls out all agents in the server.
In the script i have built using below codes :-
12-06-2023 11:54 AM
I have used this statement to make REST updates to agents in PCCE.
u = requests.put(pcce_durl, data=update_xmlbody, headers=post_headers, auth=pcce_dauth, verify=False).text
Keep in mind that any time you update something in CCE, you have to include "changeStamp" from the prior GET. This is how CCE handles concurrency. If something else (like the GUI) had made a change to that row, the changed would fail since you weren't updating from the most recent version.
12-06-2023 08:31 PM
Thanks Elliot for the helping hand. Good info!!
if you don't mind can i have the contents of these two items : "update_xmlbody" and "post_headers" as a reference to build mine.
i am newbie to all these
thanks again
12-07-2023 05:22 AM
There is only so far I think I can go since there is customer and company IP in there, but this is what I can share.
post_headers = {'Content-Type': 'application/xml'}
I use etree from the lxml libraries to build the information I am going to send, and then convert it to xml like this.
update_xmlbody = etree.tostring(Update_agent, xml_declaration=True, pretty_print=True)
12-08-2023 03:36 AM
hi Elliot,
As my 'GET' request is working fine with a output like below
pcce_api_url : "https://<Server Name>/unifiedconfig/config/agent/6617/"
Get Query : response = requests.get(pcce_api_url, auth=auth, verify=False,)
Output : (formatted to look good)
b'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<agent>
<refURL>/unifiedconfig/config/agent/6617</refURL>
<changeStamp>30</changeStamp>
<agentId>12345</agentId>
<agentStateTrace>false</agentStateTrace>
<agentTeam>
<refURL>/unifiedconfig/config/agentteam/5043</refURL>
<name>LondonSupport</name>
</agentTeam>
<datacenter>
<refURL>/unifiedconfig/config/datacenter/5191</refURL>
<name>EMEA</name>
</datacenter>
<person>
<firstName>ABCD</firstName>
<lastName>XYZ</lastName>
<loginEnabled>true</loginEnabled>
<ssoEnabled>false</ssoEnabled>
<userName>54321</userName>
</person>
<supervisor>false</supervisor>
<agentDeskSettings>
<refURL>/unifiedconfig/config/agentdesksetting/5011</refURL>
<name>Telecom</name>
</agentDeskSettings>
</agent>
12-08-2023 06:28 AM
If you are updating then the method must be PUT. The URL for the PUT is the server destination plus the refURL for the agent in the GET response. An insert would a POST. It has been a couple years since I wrote my script, so it is a little murky. I do have a vague recollection of not being able to update certain things. Sorry that isn't more specific. My suggestion would be to only include the items you are changing in your update XML. You will decrease the footprint of what you have to troubleshoot.
12-11-2023 09:14 AM
Thanks a lot Elliot
Finally now i have a working script which is updating agents details. to be frank i am short of words to explain my happiness and gratitude. thanks a lot you made my day for sure. i really don't know how really i can thank you beyond this. have a wonderful Week and wonderful yearend!!
Thanks Thomas, you initially gave me the confidence that i can start my baby steps. you too have a wonderful week and wonderful yearend!!
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