I am attempting to write some scripts in C# that will take advantage of the UCCE 11.6 Rest API. In particular, I am looking to do bulk agent creation.
I am able to successfully connect to the remote server where UCCE lives, but when I try to send a POST command with a payload, I get a "Method not Allowed". I'm assuming my payload is not formatted correctly; what is the proper formatting for the payload?
RestClient client = new RestClient("http://xxx.xxx.xxx.xxx/unifiedconfig/config/");
client.Authenticator = new HttpBasicAuthenticator("user@user.local", "passwd");
var request = new RestRequest("bulkjob/create", Method.POST);
string xmlPayload = "<create><agentId>999999</agentId><firstName>Johnny</firstName><lastName>Testuser</lastName><userName>john9999</userName><loginEnabled>true</loginEnabled><ssoEnabled>true</ssoEnabled></create>";
request.AddParameter("application/xml; charset=utf-8", xmlPayload, ParameterType.RequestBody);
request.RequestFormat = RestSharp.DataFormat.Json;
var response = client.Execute(request);
agentCreationText.AppendText("\nResponse Status: " + response.StatusCode.ToString());