The AsyncSubmitWithFile operation is used to launch an instance of a Template asynchronously where timing of the return response is critical, and where a document is sent in the communication. Just as in the SubmitWithFile operation, any values passed as pre-fill information for the document will be applied and be made visible to any signers of the document. As with SubmitWithFile, the workflow and email designs attached to a template will be used, along with any dynamically populated information intended to guide the flow of the document. The AsyncSubmitWithFile operation does not return back the document ID and AuthToken, but a temporary SessionID. This SessionID may be used in calls to the LookupSession operation to obtain the document ID and AuthToken (or any error messages) that would have been returned back synchronously in the Submit operation. This allows a developer to create a faster page load experience for their user and do a separate lookup of the document information to pull down the status.
The AsyncSubmitWithFile operation may be executed using either the W3C standard Message Transmission Optimization Mechanism (MTOM) or by converting the document to a Base64 encoded string and including it in the document. Using MTOM, the document is passed in its original raw binary form using XML-binary Optimized Packaging (XOP). Non-MTOM enabled clients may use the process of encoding the document contents and including the data as an additional element in the XML.
In general, you will be submitting similar information in an AsyncSubmitWithFile operation as in a SubmitWithFile operation.
Note: AssureSign is configured to support documents that are a maximum of 2,000 pages in length (documents being parsed for Dynamic JotBlock text tags must be 250 pages in length or less). If an attempt is made to submit a document that exceeds this configured maximum, AssureSign will return an appropriate error message. See Defining JotBlocks Through Embedded Text Tags for information on attributes that may be set to increase the 250 page limit on a given document when only a subset of pages need be parsed for Dynamic JotBlocks.
<?xml version="1.0" encoding="utf-8"?> <AsyncSubmitWithFile xmlns="https://www.assuresign.net/Services/DocumentNOW/Submit"> <Documents> <FileDocument ContextIdentifier="06C4A84A-693C-46CB-8DF2-40A8215AA056"> <Metadata UserName="email@example.com" DocumentName="John Doe Contract 2-15-2007" OrderNumber="7xe-123478" ExpirationDate="2007-04-13" Password="" Culture="en-US" SignatureDeviceSupportEnabled="false" EnvelopeId="EBB73445-AB39-CD1F-8AF5-BC06AB44E93A"> <TermsAndConditions> <AdditionalComplianceStatement> This information will be displayed at the bottom of the page and is being added for a specific jurisdiction by my code. </AdditionalComplianceStatement> <AdditionalAgreementStatement> I acknowledge that all terms and conditions of this sale have been explained to me. </AdditionalAgreementStatement> <AdditionalExtendedDisclosures> Longer extended disclosures are appended to in this section. </AdditionalExtendedDisclosures> </TermsAndConditions> </Metadata> <Template Id="DCB79445-4D39-DD11-8735-00065B8CE99B"> <Parameters> <Parameter Name="Signatory 1 First Name" Value="John" /> <Parameter Name="Signatory 1 Last Name" Value="Doe" /> <Parameter Name="Signatory 1 Email Address" Value="firstname.lastname@example.org" /> <Parameter Name="Signatory 1 Password" Value="jdoe1234" /> </Parameters> </Template> <UnderlyingFile FileType="PDF"> <Data> <xop:Include href="cid:http%3A%2F%2Ftempuri.org%2F1%2F633584454199417714" xmlns:xop="http://www.w3.org/2004/08/xop/include"/> </Data> </UnderlyingFile> </FileDocument> </Documents> </AsyncSubmitWithFile>
The SOAP Action header is
Different than the AsyncSubmit operation whereby no document is passed, using the AsyncSubmitWithFile requires the including of an UnderlyingFile element which references, within the xop:Include element, the data passed as an attachment within the SOAP message.
The FileType attribute of the UnderlyingFile element should be one of:
A SessionID will be returned that may be used to pull down the document ID and AuthToken via the LookupSession operation. The SessionID, Document ID and AuthToken returned are in the form of a global unique identifier (GUID). The Document ID and AuthToken will be required to request any further operations on an active document. The SessionID will remain active for a substantial time on the AssureSign site, so it will be possible to a limited degree to query for the asynchronous submit result for some time after the original submission.
Sample XML returned by the AsyncSubmitWithFile operation is presented here:
<?xml version="1.0" encoding="utf-8"?> <AsyncSubmitWithFileResponse xmlns="https://www.assuresign.net/Services/DocumentNOW/Submit"> <AsyncSubmitWithFileResult SessionId="96059412-2f90-48d5-ba66-8f798f3cbd8d" /> </AsyncSubmitWithFileResponse>
The AsyncSubmitWithFileResult should be checked for the presence of an Exceptions element, which may contain multiple DocumentException items.