Posted Tue, 14 Mar 2023 08:33:15 GMT by Pierre Dhuicq
Hello,

I'm trying to create a new docuware version of a document using checkout and checkin option. I can do that manually, but I have no luck when using it with rest API. 
I tried using :

{{ServerUrl}}/{{Platform}}/FileCabinets/{{FileCabinetId}}/Documents/{{DocumentId}}/checkoutDocument

and using the following body
{
    "FileCabinetId": "b_xxxxxxxxxxx"
}

The document is checked out but is not present in the basket.

Any clue to do that ?

I also need help for merging sections of a document to make only one document (both sections are PDF).

Thanks a lot for your help !

Posted Wed, 15 Mar 2023 14:24:34 GMT by Gerardo Lisanti Team Leader Product Management
Hi Pierre,

Check-Out to document tray should be:

PUT  {{ServerUrl}}/{{Platform}}/FileCabinets/{{FileCabinetId}}/Operations/ProcessDocumentAction?docId={{DocumentId}}
 
{
    "DocumentAction": "CheckOut",
    "DocumentActionParameters": {
        "$type": "CheckOutActionParameters",
        "FileCabinetId": "b_99f4b29d-a2b0-4196-a4a6-67cb74fd865c"
    }
}


Check-In from document tray should be:

PUT  {{ServerUrl}}/{{Platform}}/FileCabinets/{{DocumentTrayId}}/Operations/ProcessDocumentAction?docId={{DocumentId}}
 
{
    "DocumentAction": "CheckIn",
    "DocumentActionParameters": {
        "$type": "CheckInActionParameters",
        "Comments": "",
        "DocumentVersion": {
            "Major": 2,
            "Minor": 0
        }
    }
}
Note that the DocIDs are different for Check-Out and Check-In.


Merging of sections is called "staple" (1 section) and should be:

POST  {{ServerUrl}}/{{Platform}}/FileCabinets/{{DocumentTrayId}}/Operations/ContentMerge
 
{
    "Documents": [
        221,
        220
    ],
    "Operation": "Staple",
    "Force": true
}
Note that stapling is only supported in document trays. This ensures that documents are not lost in the filing cabinet under any circumstances.
Also, if the documents are already "clipped" (2 sections), you must first unclip and then staple.

POST  {{ServerUrl}}/{{Platform}}/FileCabinets/{{DocumentTrayId}}/Operations/ContentDivide?docId={{DocumentId}}
 
{
    "Operation": "Unclip"
}

So the procedure would probably be:
  • copy the document to a document tray (Transfer)
  • unclip
  • staple
  • store
  • delete the old document in file cabinet

​​​​​​​
Viele Grüße / With best regards,
--
Gerardo Lisanti
Product Manager  |  DocuWare GmbH

You must be signed in to post in this forum.