The AsyncSubmit operation is used to launch an instance of a Template asynchronously where timing of the return response is critical, and where a document is not sent in the communication and does not need to be externally retrieved. Just as in the Submit 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 Submit, 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 AsyncSubmit 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.
In general, you will be submitting similar information in an AsyncSubmit operation as in a Submit operation.
<?xml version="1.0" encoding="utf-8"?> <AsyncSubmit xmlns="https://www.assuresign.net/Services/DocumentNOW/Submit"> <Documents> <Document 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> </Document> </Documents> </AsyncSubmit>
The SOAP Action header is
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 AsyncSubmit operation is presented here:
<?xml version="1.0" encoding="utf-8"?> <AsyncSubmitResponse xmlns="https://www.assuresign.net/Services/DocumentNOW/Submit"> <AsyncSubmitResult SessionId="96059412-2f90-48d5-ba66-8f798f3cbd8d" /> </AsyncSubmitResponse>
The AsyncSubmitResult should be checked for the presence of an Exceptions element, which may contain multiple DocumentException items.