You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Before you start with this guide please also have a look at the API-Documentation and the Postman-Guide.

The Story 

You only want to prepare a document for the time being, but send it or have it signed later? This page explains in detail how you can create a draft via API and how you can then send this draft. The advantage you have by creating a draft compared to creating an envelope:
You can prepare the document completely and send it to your recipients at any time. Therefore, you have already prepared everything at the time of sending the draft.

Use Case Description


The following steps are necessary to send a draft:

  • Prepare a draft
  • Send the draft

This case guides you through the process of creating and sending a draft via API and UI.

Integration

All following API calls need an authorization. For information of how to authorize please see the Postman-Guide.

Creating a draft

It is allowed to define placeholders on a template, create a draft still with unresolved placeholders using the POST v6/template/createdraft method and retrieve placeholder information from the draft using GET /v6/draft/{id}. Placeholders need to be replaced before sending the draft.

First step is to create a draft. To create one you have to run the following API call:

https://demo.esignanywhere.net/Api/v6.0/draft/create

Please note: The following configuration includes one recipient who has to sign one ClickToSign:

{
    "Documents": [{
            "FileId": "19b7a4b4-1234-1234-1234-daa50efde453",
            "DocumentNumber": 1
        }
    ],
    "Name": "DraftCreate",
    "Activities": [{
            "Action": {
                "Sign": {
                    "RecipientConfiguration": {
                        "ContactInformation": {
                            "Email": "janedoe@sample.com",
                            "GivenName": "Jane",
                            "Surname": "Doe",
                            "LanguageCode": "EN",
                            "PhoneNumber":"+123456789"
                        }
                    },
                    
                    "Elements": {
                        "Signatures": [{
                                "TaskConfiguration": {
                                    "OrderDefinition": {
                                        "OrderIndex": 0
                                    }
                                },
                                "ElementId": "sample sig ClickToSign",
                                "Required": true,
                                "DocumentNumber": 1,
                                "DisplayName": "Sign here",
                                "AllowedSignatureTypes": {
                                    "ClickToSign": {
                                    }
                                },
                                "FieldDefinition": {
                                    "Position": {
                                        "PageNumber": 1,
                                        "X": 100,
                                        "Y": 200
                                    },
                                    "Size": {
                                        "Width": 100,
                                        "Height": 70
                                    }
                                }
                            }
                        ]
                    },
                    "SigningGroup": "firstSigner"
                }
            }
        }
    ]
}

After successfully creating the draft you get the draft id. We will need this id to send the draft as well as we need it for the GET call to receive the data of the draft.

If the create call was successful you can also see this draft in the UI like it is show in the next figure:

Get data of the draft

To get the data of the draft you need to run the following API call:

https://demo.esignanywhere.net/Api/v6.0/draft/{draftid}

Therefore, just replace {draftid} with your draft id and run the call. After a successful API call you should get the data of the draft like the following one:

{
    "Id": "3a086823-1234-1234-1234-6af6235b528b",
    "Name": "DraftCreate",
    "Activities": [
        {
            "Id": "12f67be4-1234-1234-1234-3907f818b2ec",
            "Action": {
                "Sign": {
                    "SigningGroup": 1,
                    "ContactInformation": {
                        "Email": "janedoe@sample.com",
                        "GivenName": "Jane",
                        "Surname": "Doe",
                        "PhoneNumber": "+123456789",
                        "LanguageCode": "EN"
                    }
                }
            }
        }
    ]
}

Update a draft

You can change the already created draft with the update API call. For this call you have to run the following URI:

https://demo.esignanywhere.net/Api/v6.0/draft/update

The POST body contains the data of the draft to update (i.e.: the updated draft configuration). A complete configuration contains:

{
  "DraftId": "string",
  "Name": "string",
  "MetaData": "string",
  "AddDocumentTimestamp": true,
  "ShareWithTeam": true,
  "LockFormFieldsOnFinish": true,
  "EmailConfiguration": {
    "Subject": "string",
    "Body": "string",
    "SenderDisplayName": "string"
  },
  "ReminderConfiguration": {
    "Enabled": true,
    "FirstReminderInDays": 0,
    "ReminderResendIntervalInDays": 0,
    "BeforeExpirationInDays": 0
  },
  "ExpirationConfiguration": {
    "ExpirationInSecondsAfterSending": 0,
    "ExpirationDate": "string"
  },
  "CallbackConfiguration": {
    "CallbackUrl": "string",
    "StatusUpdateCallbackUrl": "string",
    "AfterSendCallbackUrl": "string",
    "StepActionCallbackConfiguration": {
      "Url": "string",
      "ActionCallbackSelectionInternal": {
        "ConfirmTransactionCode": true,
        "DefaultEventType": true,
        "AgreementAccepted": true,
        "AgreementRejected": true,
        "RequestPrepareAuthenticationInformationSuccess": true,
        "PrepareAuthenticationSuccess": true,
        "AuthenticationFailed": true,
        "AuthenticationRejected": true,
        "AuthenticationSuccess": true,
        "ReAuthenticationFailed": true,
        "AuditTrailRequested": true,
        "AuditTrailXmlRequested": true,
        "CalledPage": true,
        "WhoIsInformation": true,
        "DocumentDownloaded": true,
        "FlattenedDocumentDownloaded": true,
        "AddedAnnotation": true,
        "AddedAttachment": true,
        "AppendedDocument": true,
        "FormsFilled": true,
        "ConfirmReading": true,
        "PageViewChanged": true,
        "SendTransactionCode": true,
        "PrepareSignWorkstepDocument": true,
        "SignWorkstepDocument": true,
        "UndoAction": true,
        "WorkstepCreated": true,
        "WorkstepFinished": true,
        "WorkstepRejected": true,
        "DisablePolicyAndValidityChecks": true,
        "EnablePolicyAndValidityChecks": true,
        "AppendFileToWorkstep": true,
        "AppendTasksToWorkstep": true,
        "SetOptionalDocumentState": true,
        "PreparePayloadForBatch": true
      },
      "ActionCallbackSelection": {
        "ConfirmTransactionCode": true,
        "DefaultEventType": true,
        "AgreementAccepted": true,
        "AgreementRejected": true,
        "RequestPrepareAuthenticationInformationSuccess": true,
        "PrepareAuthenticationSuccess": true,
        "AuthenticationFailed": true,
        "AuthenticationRejected": true,
        "AuthenticationSuccess": true,
        "ReAuthenticationFailed": true,
        "AuditTrailRequested": true,
        "AuditTrailXmlRequested": true,
        "CalledPage": true,
        "WhoIsInformation": true,
        "DocumentDownloaded": true,
        "FlattenedDocumentDownloaded": true,
        "AddedAnnotation": true,
        "AddedAttachment": true,
        "AppendedDocument": true,
        "FormsFilled": true,
        "ConfirmReading": true,
        "PageViewChanged": true,
        "SendTransactionCode": true,
        "PrepareSignWorkstepDocument": true,
        "SignWorkstepDocument": true,
        "UndoAction": true,
        "WorkstepCreated": true,
        "WorkstepFinished": true,
        "WorkstepRejected": true,
        "DisablePolicyAndValidityChecks": true,
        "EnablePolicyAndValidityChecks": true,
        "AppendFileToWorkstep": true,
        "AppendTasksToWorkstep": true,
        "SetOptionalDocumentState": true,
        "PreparePayloadForBatch": true
      }
    }
  },
  "AgentRedirectConfiguration": {
    "Policy": "None",
    "Allow": true,
    "IframeWhitelisting": [
      "string"
    ]
  },
  "AgreementConfiguration": {
    "UseOrganizationAgreementSettings": true,
    "Translations": [
      {
        "LanguageCode": "AF",
        "Text": "string",
        "Header": "string",
        "IsDefault": true
      }
    ]
  },
  "RedirectConfiguration": {
    "AfterSendRedirectUrl": "string",
    "BeforeSendRedirectUrl": "string"
  }
}

Sending a draft

To send the draft you need to run the following API call:

https://demo.esignanywhere.net/Api/v6.0/draft/send

Add the draftId and send the envelope:

{
  "DraftId": "string"
}

After a successful sending of the draft, the recipients will get the envelope.

  • No labels