cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1047
Views
7
Helpful
11
Replies

Is there a WSDL kind of SOAP API / AXL available for PCCE and UCCE ?

Chidananda S
Level 1
Level 1

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.

2 Accepted Solutions

Accepted Solutions

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

 

Please rate helpful posts and if applicable mark "Accept as a Solution".
Thanks, Thomas G. J.

View solution in original post

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.

View solution in original post

11 Replies 11

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

 

Please rate helpful posts and if applicable mark "Accept as a Solution".
Thanks, Thomas G. J.

Chidananda S
Level 1
Level 1

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 have a wonderful weekend.

Chidananda S
Level 1
Level 1

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

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)

Please rate helpful posts and if applicable mark "Accept as a Solution".
Thanks, Thomas G. J.

Chidananda S
Level 1
Level 1

hi Thomas, 

hope you are having a wonderful day thanks again for a quick response.

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 :-

 
pcce_api_url = "https://<Server Name>/unifiedconfig/config/agent/
 
*In the below payload i have even tried using "
 
"refURL":"<refURL>https://<Server Name>/unifiedconfig/config/agent/6619</refURL>",
"
payload = {
    "refURL":"<refURL>/unifiedconfig/config/agent/6619</refURL>",
    "userName": AgentUserName,
    "firstName": new_first_name,
    "person.firstName": "Hello"
    # Add other parameters as needed for your specific API
}
 
response = requests.post(pcce_api_url, auth=auth, verify=False, json=payload) # here even i have tried with requests.put() but no luck
 
here it is successfully getting authenticated but getting either 400 or 415 error code. 
So i am suspecting here something wrong with "payload" data. Do you have a reference payload data which i can try to replicate and see if i can do update user details?

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.

Chidananda S
Level 1
Level 1

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

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)

Chidananda S
Level 1
Level 1

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 Queryresponse = 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>

 
 
i decided to use the same XML data in the POST/PUT with few changes like below
1) changed the Fistname
2) Query updated like below :
headers= {'Content-Type': 'application/xml'}
response = requests.post / put (pcce_api_url, auth=auth, verify=False, headers=post_headers, data=soaprequest01)
 
And getting this error :
405
b'<!doctype html><html lang="en"><head><title>HTTP Status 405 \xe2\x80\x93 Method Not Allowed</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 405 \xe2\x80\x93 Method Not Allowed</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> Method Not Allowed</p><p><b>Description</b> The method received in the request-line is known by the origin server but not supported by the target resource.</p><hr class="line" /><h3>Apache Tomcat/7.0.108</h3></body></html>'
 
i am not sure what needs to be updated here, could you please help me to understand this? you may update this above xml content which i have shared here. 
 
Thanks in advance

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.

Chidananda S
Level 1
Level 1

Thanks a lot Elliot you really walked me through every baby steps to the resolution

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!!