10-30-2017 03:29 AM - edited 03-14-2019 05:40 PM
Hey.
When i try to update skills on an agent thru the API (on a c# code) on a ucce 10.5 I keep getting error 415 (unsupported media type).
This failure is only comming on my post calls - so i can without problem get the skills on my agent, but i cannot change them (Via Post).
If I try to change them i PostMan it works fine (Same username/password and same XML).
Here is my cSharp code where im using RestSharp:
System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate (object obj, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; }; System.Net.ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls; var client = new RestClient(); client.BaseUrl = new Uri(adminUrl); client.Authenticator = new HttpBasicAuthenticator(adminUid, adminPwd); var request = new RestRequest(); request.Resource = "/unifiedconfig/config/operation"; request.Method = Method.POST;
request.AddHeader("Content-Type", "application/xml");
request.AddHeader("Cache-Control", "no-cache");
request.AddHeader("Accept", "application/xml");
request.Parameters.Clear();
request.RequestFormat = RestSharp.DataFormat.Xml;
request.AddBody(xml);
IRestResponse response = client.Execute(request);
And here is my XML in sending;
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <operation> <operationType>update</operationType> <refURLs> <refURL>/unifiedconfig/config/agent/9017</refURL> </refURLs> <changeSet> <agent> <skillGroupsRemoved> <skillGroup> <refURL>/unifiedconfig/config/skillgroup/5738</refURL> </skillGroup> </skillGroupsRemoved> </agent> </changeSet> </operation>
The username and password is an Supervisor and the agent is in the team.
Has anyone had this problem ?
Best regards
Thomas
01-29-2018 08:05 AM
This feature is not available in release 10.x
see: https://supportforums.cisco.com/t5/contact-center/need-help-in-ucce-admin-api-usage/td-p/2663948
But available from 11.5
10-09-2018 07:39 AM
Hi NICNGUYEN,
Did you ever try to use the agent API to change agent's attributes or password? I am trying to change the agent's password using the agent API.
When I query the agent's changeStamp I used the admin login credential (FQDN). No issues as I was able to get the latest changeStamp. I switch over to supervisor login credential when I want to change the password. The web request returns "401 Unauthorized". Any idea how to setup supervisor login name?
Thanks.
danny
10-09-2018 07:32 AM
Hi Thomas,
I am trying to used Agent API to change agent's password. How did you set up the supervisor login name and credential?
I am getting 401 Not Authorized when I use the supervisor login credential to change agent's password.
First, I used the administrator FQDN to get the changeStamp and that works fine. But switch to supervisor login credential when trying to update the agent's password. That is when I get the 401 back.
Thanks in advance.
Danny
10-09-2018 07:54 AM - edited 10-09-2018 08:00 AM
Hey Danny.
Which version are you using ?
In version 10.x you have to use a supervisor login (and the supervisor has to be a supervisor for the user you are trying to change) username is "supervisorname"
In version 11.x you have to use an administrator login to do the task
From the documentation
Best regards Thomas
10-09-2018 08:07 AM
10-09-2018 08:13 AM
10-09-2018 08:17 AM
10-09-2018 08:29 AM
Our client does not allow third-party/open-source software on their laptop. So, I basically wrote a C# console app and test it on my company's laptop got it to work using UCCE 11.5. UCCE 11.5 is more stable and I am using admin (FQDN). Don't need supervisor login name as compare to UCCE 10.5.
Thanks.
danny
10-09-2018 09:43 AM
Hi Thomas,
I intentionally gave it the wrong login id or password. I am getting a 401 "Not Authorized". Any idea what could be the issues?
Thanks.
Danny
10-09-2018 08:20 AM
10-09-2018 08:32 AM
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