• RE: How I can clip new files in basket into an existing document in cabinet using platform API?

    At first copy / move the document from the basket to the file cabinet (Copy index data + content). Afterwards Clip the documents inside the file cabinet.Example code:
    public static void ClipDocuments()
    {
        // Get documents
        Document docBasket = GetDocument("<<fcID>>", <<docID>);
        Document docFileCabinet = GetDocument("<<fcID>>", <<docID>>);
    
        // Get file cabinet + basket and copy document
        FileCabinet basket = connection.GetFileCabinet(<<BasketID>>).GetFileCabinetFromSelfRelation();
        FileCabinet fc = connection.GetFileCabinet("<<FCID>>").GetFileCabinetFromSelfRelation();
        int docID = CopyFromBasketToFileCabinet(docBasket, fc);
       
        // Clip the documents
        ContentMergeOperationInfo operationInfo = new ContentMergeOperationInfo()
        {
            Documents = new List<int>() { docFileCabinet.Id, docID },
            Force = true,
            Operation = ContentMergeOperation.Clip,
        };
        fc.PutToContentMergeOperationRelationForDocument(operationInfo);
    }
    
    private static Document GetDocument(string FCGuid, int docID)
    {
        return connection.GetFromDocumentForDocumentAsync(docID, FCGuid).Result;
    }
    
    private static int CopyFromBasketToFileCabinet(Document docBasket, FileCabinet fc)
    {
        DialogInfo dialog = fc.GetDialogInfosFromStoresRelation().Dialog.First(d => d.FileCabinetId == fc.Id);
        Document docNew = dialog.PostToStoreDocumentRelationForDocument(docBasket);
        docNew.PostToSectionsRelationForSection("application/pdf", docBasket.Sections[0].GetSectionFromSelfRelation().GetStreamFromContentRelation());
        return docNew.Id;
    }
  • RE: REST API - How to delete first section of a document ?

    You can delete a section via REST-API by sending a request to the endpoint within the platform using the DELETE method. You can use following REST call to delete a section:

    [DELETE] https://{URI}/DocuWare/Platform/FileCabinets/{FCID}/Sections/{SectionID}