Reply to: Copying Documents from one package to another
Sunday, January 6, 2019 at 12:23pm
0
votes
Hi Duo,
Thank you for your response, but I'm not sure if I can use that, here is the scenario:
Package A has Document#1 and Document#2
Package B has Document#3 and Document#4
I need to create a package C that has Document#1 and Document#3. I was wondering if there is a way maybe like an API that gets DocumentIds and would clone them into the Package C.
based on your response, I'm wondering if I can use your solution and create empty files(so smaller payload) and put them into Package C and then use Layout to copy them over to C, do you think that would work?
Thanks,
Sara
Reply to: Copying Documents from one package to another
Sunday, January 6, 2019 at 12:37pmHTTP Request POST /api/packages/{packageId}/documents HTTP Headers Accept: text/html Content-Type: multipart/form-data Authorization: Basic api_key Request Payload ------WebKitFormBoundary1bNO60n7FqP5WO4t Content-Disposition: form-data; name="file"; filename="testDocumentExtraction.pdf" Content-Type: application/pdf %PDF-1.5 %µµµµ 1 0 obj >>> endobj.... ------WebKitFormBoundary1bNO60n7FqP5WO4t Content-Disposition: form-data; name="payload" { "id": "document_id", "name": "document_name" } ------WebKitFormBoundary1bNO60n7FqP5WO4t--DuoReply to: Copying Documents from one package to another
Sunday, January 6, 2019 at 10:46amHTTP Request POST /api/layouts HTTP Headers Accept: application/json Content-Type: application/json Authorization: Basic api_key Request Payload { "name":"layout_name", "type":"LAYOUT", "id":"source_package_id", "visibility":"SENDER", "documents":[ { "id":"source_document_id" } ] }#2. retrieve the layout ID from response payload of #1 REST call #3. apply the layout to target document:HTTP Request POST /api/packages/{packageId}/documents/{documentId}/layout?layoutId={layoutId} HTTP Headers Accept: application/json Content-Type: application/json Authorization: Basic api_keyNote: 1.layoutID is the one you got from #2 2.no need for request payload Hope this could help! DuoReply to: Copying Documents from one package to another
Sunday, January 6, 2019 at 12:23pmReply to: Copying Documents from one package to another
Sunday, January 6, 2019 at 12:41pm