Veröffentlicht Mon, 28 Oct 2024 18:47:47 GMT von Samir ZARROUK INGE-COM Project manager
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);
 
Veröffentlicht Tue, 05 Nov 2024 00:00:20 GMT von Matthias Wieland Senior Director Support EMEA
Dear Samir ZARROUK! It looks like the Community cannot answer your question. That's why we have opened a Support Request with the Number SR-244983-N1G4H for you. A Software Support Specialist will contact you directly to follow up. We will update this thread with the solution as soon as we have resolved the Support Request. With best regards, DocuWare Support Team

Sie müssen angemeldet sein um Beiträge in den Foren zu erstellen.