Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
themeEclipse
{
    "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:

Image Removed

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:

Please note that it is possible to add a default signature type for the draft (only one signature type is allowed to be set to default). See the next configuration (also available for the update craft call):

Code Block
languagejava
themeEclipse
{
    "Documents": [{
            "FileId": "075f6443-9d96-43d4-9c41-6957fafa44d1",
            "DocumentNumber": 1
        }
    ],
Code Block
languagejava
themeEclipse
{
    "IdName": "3a086823-1234-1234-1234-6af6235b528bDraftCreate",
    "NameActivities": "DraftCreate",[{
    "Activities": [
       "Action": {
                "IdSign": "12f67be4-1234-1234-1234-3907f818b2ec",
         {
   "Action": {
                "SignRecipientConfiguration": {
                    "SigningGroup": 1,
                    "ContactInformation": {
                            "Email": "janedoe@samplejane.doe@sample.com",
                            "GivenName": "Jane",
                            "Surname": "Doe",
                            "PhoneNumberLanguageCode": "+123456789EN",
                            "LanguageCodePhoneNumber": "EN+123456789"
                        }
                    },
                }     
        }
            ]
}

Update a draft

Info

Even if only an empty string for e.g. "Name" is entered, the value of the draft will be adjusted. Therefore, after the update call the draft name would be "". If you do not want certain data from the draft to be changed by the update call, then do not include the value in the json structure. This keeps the value of the draft before updating it and only those declared in the json are changed.

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:

"Elements": {
                        "Signatures": [{
                                "TaskConfiguration": {
                                    "OrderDefinition": {
                                        "OrderIndex": 0
                                    }
                                },
                                "ElementId": "sample sig ClickToSign",
                                "Required": true,
                                "DocumentNumber": 1,
                                "DisplayName": "Sign here",
                                "AllowedSignatureTypes": {
                                    "ClickToSign": {
                                        
                                    },
                                     "DrawToSign": {
                                       
                                    }
                                },
                                "FieldDefinition": {
                                    "Position": {
                                        "PageNumber": 1,
                                        "X": 100,
                                        "Y": 200
                                    },
                                    "Size": {
                                        "Width": 100,
                                        "Height": 70
                                    }
                                }
                            }
                               
                        ]
                    },
                     
                    "SigningGroup": "firstSigner"
                }
               
            }
        }
        
    ],
    "DefaultSignatureTypeConfiguration": {
    "ClickToSign": {
      "IsDefault": false
    },
    "DrawToSign": {
      "IsDefault": true
    },
    "TypeToSign": {
      "IsDefault": false
    },
    "LocalCertificate": {
      "IsDefault": false
    },
    "DisposableCertificate": {
      "IsDefault": false
    },
    "Biometric": {
      "IsDefault": false
    },
    "RemoteCertificate": {
      "IsDefault": false
    },
    "OneTimePassword": {
      "IsDefault": false
    }
                     }
}

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:

Image Added

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:

Code Block
languagejava
themeEclipse
{
    "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

Info

Even if only an empty string for e.g. "Name" is entered, the value of the draft will be adjusted. Therefore, after the update call the draft name would be "". If you do not want certain data from the draft to be changed by the update call, then do not include the value in the json structure. This keeps the value of the draft before updating it and only those declared in the json are changed.

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:

Code Block
languagejava
themeEclipse
{
  "DraftId": "string",
  "Name": "string",
  "MetaData": "string",
  "AddDocumentTimestamp": true,
  "ShareWithTeam": true,
  "LockFormFieldsOnFinish": true,
  "SendFinishedDocumentsToAllSignersAndMustView": true,
  "EmailConfiguration": {
    "Subject": "string",
    "Message": "string",
    "SenderDisplayName": "string"
  },
  "ReminderConfiguration": {
    "Enabled
Code Block
languagejava
themeEclipse
{
  "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,
        "FlattenedDocumentDownloadedFirstReminderInDays": true0,
        "AddedAnnotationReminderResendIntervalInDays": true0,
        "AddedAttachmentBeforeExpirationInDays": true,0
     },
   "AppendedDocumentExpirationConfiguration": true,{
        "FormsFilledExpirationInSecondsAfterSending": true0,
    "ExpirationDate": "2023-04-18T08:26:00.440Z"
  },
  "ConfirmReadingCallbackConfiguration": true,{
        "PageViewChangedCallbackUrl": true"string",
        "SendTransactionCodeStatusUpdateCallbackUrl": true"string",
        "PrepareSignWorkstepDocumentAfterSendCallbackUrl": true"string",
        "SignWorkstepDocumentActivityActionCallbackConfiguration": true,{
        "UndoActionUrl": true"string",
        "WorkstepCreatedActionCallbackSelection": true,{
        "WorkstepFinishedConfirmTransactionCode": true,
        "WorkstepRejectedAgreementAccepted": true,
        "DisablePolicyAndValidityChecksAgreementRejected": true,
        "EnablePolicyAndValidityChecksPrepareAuthenticationSuccess": true,
        "AppendFileToWorkstepAuthenticationFailed": true,
        "AppendTasksToWorkstepAuthenticationSuccess": true,
        "SetOptionalDocumentStateAuditTrailRequested": true,
        "PreparePayloadForBatchAuditTrailXmlRequested": true,
      },
      "ActionCallbackSelectionCalledPage": {true,
        "ConfirmTransactionCodeDocumentDownloaded": true,
        "DefaultEventTypeFlattenedDocumentDownloaded": true,
        "AgreementAcceptedAddedAnnotation": true,
        "AgreementRejectedAddedAttachment": true,
        "RequestPrepareAuthenticationInformationSuccessAppendedDocument": true,
        "PrepareAuthenticationSuccessFormsFilled": true,
        "AuthenticationFailedConfirmReading": true,
        "AuthenticationRejectedSendTransactionCode": true,
        "AuthenticationSuccessPrepareSignWorkstepDocument": true,
        "ReAuthenticationFailedSignWorkstepDocument": true,
        "AuditTrailRequestedUndoAction": true,
        "AuditTrailXmlRequestedWorkstepCreated": true,
        "CalledPageWorkstepFinished": true,
        "WhoIsInformationWorkstepRejected": true,
        "DocumentDownloadedDisablePolicyAndValidityChecks": true,
        "FlattenedDocumentDownloadedEnablePolicyAndValidityChecks": true,
        "AddedAnnotationAppendFileToWorkstep": true,
        "AddedAttachmentAppendTasksToWorkstep": true,
        "AppendedDocumentSetOptionalDocumentState": true,
        "FormsFilledPreparePayloadForBatch": true,
      }
    }
  },
  "ConfirmReadingAgentRedirectConfiguration": true,{
    "Policy": "Workflow",
    "PageViewChangedAllow": true,
    "IFrameAllowList": [
      "SendTransactionCodestring": true,
    ]
  },
  "PrepareSignWorkstepDocumentAgreementConfiguration": true,
    {
    "SignWorkstepDocumentTranslations": true,[
        "UndoAction": true,{
        "WorkstepCreatedLanguageCode": true"AF",
        "WorkstepFinishedText": true"string",
        "WorkstepRejectedHeader": true"string",
        "DisablePolicyAndValidityChecksIsDefault": true,
        "EnablePolicyAndValidityChecks": true,}
    ]
  },
  "AppendFileToWorkstepRedirectConfiguration": true,{
        "AppendTasksToWorkstepAfterSendRedirectUrl": true"string",
    "BeforeSendRedirectUrl": "string"
  },
  "SetOptionalDocumentStateDefaultSignatureTypeConfiguration": true,{
        "PreparePayloadForBatchClickToSign": true{
      "IsDefault": }true
    },
  },
  "AgentRedirectConfigurationDrawToSign": {
      "PolicyIsDefault": "None",false
    "Allow": true},
    "IframeWhitelistingTypeToSign": [{
      "stringIsDefault": false
    ]},
  },
  "AgreementConfigurationLocalCertificate": {
      "UseOrganizationAgreementSettingsIsDefault": true,false
    "Translations": [},
    "DisposableCertificate":  {
        "LanguageCodeIsDefault": "AF",false
    },
    "TextBiometric": "string",{
        "HeaderIsDefault": "string",false
    },
    "IsDefaultRemoteCertificate": true{
      "IsDefault": }false
    ]},
  },
  "RedirectConfigurationOneTimePassword": {
      "AfterSendRedirectUrlIsDefault": "string",false
    "BeforeSendRedirectUrl": "string"}
  }
}

Sending a draft

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

...