I am trying to create a cabinet using REST API but I get an 404 error message.
" method \u0027Self\u0027 was not found on controller"
"Method":"POST","StatusCode":404,"Status":"Not Found"
I don't see what is wrong, my code below
List<Field> fields = new List<Field>
{
new Field()
{
DBFieldName = "NOM",
FieldType = "Text",
Length = 255,
FieldLabel = "Nom",
IsRequired = true,
}
};
Armoire armoire = new Armoire()
{
Name = "My cabinet",
Dialog = new Dialog()
{
DefaultResultListDialogType = "Default",
FulltextIndexingMode = "Automatic"
},
Fields = fields
};
string sUri = $"{uri}/DocuWare/Platform/Organizations/FileCabinets";
RestClientOptions rOptions = new RestClientOptions(sUri)
{
ThrowOnAnyError = true,
Timeout = TimeSpan.FromSeconds(nTimeOut),
};
RestClient client = new RestClient(rOptions);
RestRequest request = new RestRequest();
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("cache-Control", "no-cache");
request.AddHeader("Connection", "keep-alive");
request.AddHeader("Authorization", $"Bearer {sBearer}");
request.AddBody(armoire);
RestResponse response = client.Execute(request, Method.Post);
Console.WriteLine(response.Content);