cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
335
Views
0
Helpful
1
Replies

Finesse REST API

Hi !

I am trying to change agent state using REST API. I am using C# as a programming language.

here is the code that I wrote :

ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(AcceptAllCertifications);

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(new Uri("https://url:8445/finesse/api/User/agent2"));
request.Credentials = new NetworkCredential("agent2", "12345");

request.Method = "POST";
request.ContentType = "application/xml";
// request.Accept = "application/xml";

XElement redmineRequestXML =
new XElement("User",
new XElement("state", "READY"),
new XElement("extension", "3010")
);

byte[] bytes = Encoding.UTF8.GetBytes(redmineRequestXML.ToString());

request.ContentLength = bytes.Length;

using (Stream putStream = request.GetRequestStream())
{
putStream.Write(bytes, 0, bytes.Length);
}

// Log the response from Redmine RESTful service
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
MessageBox.Show(reader.ReadToEnd());
}

 And I am getting this error : 

The remote server returned an error: (405) Method Not 

so please any idea could help solving this issue ? 

1 Reply 1

Chris Deren
Hall of Fame
Hall of Fame

You might want to ask dev related questions on this forum instead:

https://communities.cisco.com/community/developer/finesse

Chris