← FlexAPI Documentation / API Calls / AddDocument
The AddDocument method adds one or more documents to an existing transaction, separately from the original SubmitDocument call. It is useful when the integrating platform limits how much can be uploaded in a single request: submit the transaction first, then add documents in succession, each in its own request. A single request can carry one document or many. Added in SIGNiX Release 181.
DocumentSetID. This is the ID returned when the transaction was submitted.MemberInfo or other transaction elements. The request carries only the DocumentSetID and the new documents.Form is formatted exactly as in SubmitDocument. See SubmitDocument - Request XML for every Form element, including FormStructure and Covers.SignatureLine) in the request. Alternatively, send the signer or submitter to tag the documents by hand with a GetAccessLink request for the submitter.MemberInfoNumber must match an existing signer. It refers to a signer already in the transaction.CustInfo credentials as your other requests (Sponsor, Client, UserId and Pswd).An annotated example of the request XML follows. The request holds the DocumentSetID and any number of Form elements, so it can add one document or many.
<?xml version="1.0" ?>
<AddDocumentRq xmlns="urn:com:signix:schema:sdddc-1-1">
<CustInfo> <!-- Occurs once only -->
<!-- Assigned by SIGNiX when the Client is set up. All case sensitive. -->
<Sponsor>YOUR_SPONSOR</Sponsor>
<Client>YOUR_CLIENT</Client>
<UserId>YOUR_USER</UserId>
<Pswd>YOUR_PASSWORD</Pswd>
</CustInfo>
<Data> <!-- Occurs once only -->
<!-- Required. The transaction to add to. The transaction must be suspended and not
complete, and no task on an existing document may be complete. -->
<DocumentSetID>YOUR_DOCUMENT_SET_ID</DocumentSetID>
<!-- Occurs once for each document being added. Formatted exactly as in SubmitDocument. -->
<Form>
<RefID>YOUR_REF_ID</RefID>
<Desc>YOUR_DOCUMENT_DESCRIPTION</Desc>
<FileName>YOUR_FILE_NAME.pdf</FileName>
<MimeType>application/pdf</MimeType>
<!-- Optional. Tasks for a signer already in the transaction. MemberInfoNumber must match
an existing signer. You cannot add or change signers here. -->
<SignatureLine>
<MemberInfoNumber>1</MemberInfoNumber>
<SignField>Signature1</SignField>
<DateSignedField>Signature1Date</DateSignedField>
<DateSignedFormat>MM/dd/yy</DateSignedFormat>
</SignatureLine>
<!-- The document size and content, as in SubmitDocument. -->
<Length>16417</Length>
<Data>BASE64_PDF</Data>
</Form>
</Data>
</AddDocumentRq>
An annotated example of the response XML follows. See Status Codes on the main API page for the possible values and meanings of the StatusCode and StatusDesc elements.
A successful request returns a simple response: a StatusCode of 0 and a restatement of the DocumentSetID the documents were added to.
<?xml version="1.0" ?>
<AddDocumentRs xmlns="urn:com:signix:schema:sdddc-1-1">
<Status> <!-- Occurs once only -->
<StatusCode>0</StatusCode> <!-- One of the numeric SC_* values -->
<StatusDesc>success</StatusDesc> <!-- Human-readable version of StatusCode -->
</Status>
<Data> <!-- Optional. Occurs when Status.StatusCode is 0. -->
<!-- The transaction the document(s) were added to. -->
<DocumentSetID>YOUR_DOCUMENT_SET_ID</DocumentSetID>
</Data>
</AddDocumentRs>
If the transaction is not suspended, or is already complete, the request returns an error and no documents are added. The same applies when the transaction is suspended but one of its existing documents has a completed task. Check StatusCode before reading anything else, and use StatusDesc to see the reason.
<?xml version="1.0" ?>
<AddDocumentRs xmlns="urn:com:signix:schema:sdddc-1-1">
<Status> <!-- Occurs once only -->
<StatusCode>101</StatusCode> <!-- Non-zero: the request failed -->
<StatusDesc>Transaction is not in suspend status. Document can not be added.</StatusDesc>
</Status>
<!-- No Data element on an error. -->
</AddDocumentRs>
1110 Market Street, Suite 402
Chattanooga, TN 37402
877.890.5350
info@SIGNiX.com
©2016 SIGNiX. All Rights Reserved.