DocuSign eSign RestApi ChunkedUploads

最后都变了- 提交于 2019-12-13 02:16:52

问题


I have a question about ChunkedUploads.

Currently I am working on the solution for this post:

DocuSign API Envelope creation timed out

Can anyone explain how to send an EnvelopeDefinition in chunks ?

Currently I call:

var request = new ChunkedUploadRequest()
            { 
              Data = <how to put the envelopeDefinition content here?> 
            };

var response = envelopesApi.CreateChunkedUploadAsync( ApiAccountId, request );

Edit

I am trying to understand how to wrap an EnvelopDefinition object into a ChunkedUploadRequest object.

As simple as possible: What should the data property of the ChunkedUploadRequest object look like? What should the data contain? I cannot find any detailed explanation on the subject in the official eSignature documentation: https://docs.docusign.com/esign/restapi/Envelopes/ChunkedUploads/create/#/definitions/chunkedUploadRequest


回答1:


You break the base64 (I tried with base64) string into multiple parts, each part is a sequence. Then below are the API calls seq:

  • Create ChunkUpload - POST /v2/accounts/{accountId}/chunked_uploads, this returns the chunkedUploadId and chunkedUploadUri. chunkedUploadId will be used for more chunkupload related calls, like update more stream on the chunk or for committing the chunkupload. chunkedUploadUri will be used to add document in the create envelope call, it will be referred in remoteUrl inside "document" node.

Response will be like:

{
"chunkedUploadId": "C4AE9DF7-E3E4-4F3F-B419-29F59647D860",
"chunkedUploadUri": "docusignchunkedupload://C4AE9DF7-E3E4-4F3F-B419-29F59647D860",
...
}
  • Then PUT /v2/accounts/{accountId}/chunked_uploads/{chunkedUploadId}/{chunkedUploadPartSeq} call is required to uploaded remaining part of the the base64 document (other part of the string). Sequence will increase like 1,2,3 etc

  • Finally Chunk Commit call, PUT /v2/accounts/{accountId}/chunked_uploads/{chunkedUploadId} to make this Chunk available to be used in create envelope call once all the chunk of a document is added.

  • In Create envelope call, you will refer to chunk as below

    Envelope Definition's document will look like below
    
    
       "documents": [{
    "remoteUrl": "docusignchunkedupload://C4AE9DF7-E3E4-4F3F-B419-29F59647D860",
    "documentId": "1",
    "name": "Test"
    

    }

     `remoteUrl` is the `chunkedUploadUri` returned in the first call.
    


来源:https://stackoverflow.com/questions/49875782/docusign-esign-restapi-chunkeduploads

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!