Versions Compared

Key

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

...

Info
titleAttention

Please note that this documentation and the links refer to the api v6. For more information please see the migration guide and the documentation related to v5.

...

eSignAnyWhere can be easily implemented. This tutorial shows you how to send your first envelope via REST api service of eSignAnyWhere. If you are using Postman for your REST calls please also have a look at the following Tutorial: Visit postman tutorial.
Please also see the developer mode: . Developer mode
For this tutorial you can use your desired programming language (with REST support) or any REST tool (e. g. Postman). Moreover you will need an active eSignAnyWhere account for the authorization. (Even a trial account will work).

Some other interesting documentation links:

...

The tutorial will show you the following basic use-case:

Image RemovedBasic Use CaseImage Added

Hello World

Before starting with the first request please note the following:

...

If you authorize with the apiToken just add the apiToken in the header of the api call. Please see the next sample authorization (Bearer token):

KeyValue
"Authorization""Bearer asdfngtmvv8pfmsuaxpzz85zux3e63dd9zttrwitx9mln6qka6tds83du3p3lroe"

Please see the next sample authorization (api token):

KeyValue
"ApiToken""asdfngtmvv8pfmsuaxpzz85zux3e63dd9zttrwitx9mln6qka6tds83du3p3lroe"

Version request

First we will try the connection with a version request. You can find the endpoints in the next table:


Code Block
languagejava
themeEclipse
firstline0
titleREST Response
"22.20.0.71"

...

First we have to upload a document. This will return a documentId, to use the document for creating an envelope. Therefore, we will use the following endpoint:

For this tutorial we just use a simple PDF document. You can download it here or use your own document.

...

To receive an adhoc configuration you can use the following endpoint:


Code Block
languagejava
themeEclipse
firstline0
titleREST Call
{
  "FileIds": [
    "3252931f-1234-420c-1234-0c7656d8d2ea"
  ]
}

...

For sending an envelope we are using the following endpoint:


The envelope configuration defines the envelope and the steps in the workflow. For each action you need to define a configuration, which defines what the signer has to do in his/her singing task.

...

Code Block
languagejava
themeEclipse
titleREST Call
{
    "Documents": [{
            "FileId": "83467fdcd33d43ca-1234-45921234-1234-9c64787cd7a1b645fc4e0fb2",
            "DocumentNumber": 1
        }
    ],
    "Name": "Test",
    "Activities": [{
            "Action": {
                "Sign": {
                    "RecipientConfiguration": {
                        "ContactInformation": {
                            "Email": "janedoe@samplejane.doe@sample.com",
                            "GivenName": "Jane",
                            "Surname": "Doe",
                            "LanguageCode": "EN"
                        }
                    },
                    "Elements": {
                        "Signatures": [{
                                "TaskConfigurationElementId": {
"sample sig click2sign",
                                  "OrderDefinitionRequired": {
       true,
                                 "OrderIndexDocumentNumber": 01,
                                "DisplayName": "Sign here",
     }
                           "AllowedSignatureTypes": {
    },
                                "IdClickToSign": "sample{
  sig click2sign",
                                "Required": true, }
                                "DocumentNumber": 1},
                                "DisplayNameFieldDefinition": "Sign here",
{
                                    "AllowedSignatureTypesPosition": {
                                        "ClickToSignPageNumber": {1,
                                    }
    "X": 100,
                           },
             "Y": 200
                  "FieldDefinition": {
                 },
                   "Position": {
                                        "PageNumber"Size": 1,{
                                        "XWidth": 100,
                                        "YHeight": 20070
                                    },
                                }
     "Size": {
                      }
                  "Width": 100,
     ]
                    }
               "Height": 70}
            }
        }, {
               }"Action": {
                "SendCopy": {
               }
     "RecipientConfiguration": {
                      }
  "ContactInformation": {
                     ]
           "Email": "john.doe@sample.com",
         },
                    "SigningGroupGivenName": "firstSignerJohn",
                 }
            }
"Surname": "Doe",
             },   {
            "ActionLanguageCode": {"EN"
                "SendCopy": {
        }  
           "RecipientConfiguration": {
        }
                "ContactInformation": {}
            }
        }
    ]
}


Code Block
languagejava
themeEclipse
titleREST Response
{
    "EmailEnvelopeId": "johndoe@sample.com",
                            "GivenName": "John",
 45fd01ce-1234-4792-1234-f5230e41b130"
}


The envelope id is used for managing the envelopes (send reminder, cancel delete, reject envelope,…).

After the successful creation of the envelope, it is sent to the first recipient.

Open the envelope

 After you have sent the envelope and you have got the envelopeId you can call the method https://demo.esignanywhere.net/api/v6/envelope/{envelopeId}/viewerlinks.  With the result of this method you get information about the envelope and you can find the workstepRedirectionURL (Viewerlink).

Code Block
languagejava
themeEclipse
titleREST Response
{
    "ViewerLinks": [
                           "Surname": "Doe",
                            "LanguageCode": "EN"
                        }  
                    }{
            "ActivityId": "5609d2ea-1234-1234-1234-1959e63fde64",
   }
         "Email": "john.doe@sample.com",
  }
        }
    ]
}
Code Block
languagejava
themeEclipse
titleREST Response
{
    "EnvelopeId": "45fd01ce-1234-4792-1234-f5230e41b130"
}

The envelope id is used for managing the envelopes (send reminder, cancel delete, reject envelope,…).

"ViewerLink": "https://demo.esignanywhere.net/workstepredirector/sign?identifier=mdIkzVC1234512IgiOLD3Iodfynd~12345RbJQXusyZuCNp7FR6PniOT12345B~fQ1234A=="
        }
    ]
}

With this redirection link it is possible to open and sign the document in your web portalAfter the successful creation of the envelope, it is sent to the first recipient.

Find the envelope

Note
Authorization is required.

After sending the envelope you can use the following api call to search for the envelope:


In the next section you can find a sample configuration which you need for the api call:

...

You can search for the following status:

Status
Canceled
Completed
Expired
Rejected
ActionRequired
WaitingForOthers

ExpiringSoon

Active

If you have not finished the envelope then search for “Active” envelopes, if the envelope is already finished please search for “Completed” envelopes to find the envelope you have sent in the api call above.
As response from this api call you will get a list of all envelopes which fulfill the status. Please see the following sample response:

...

The envelope id can be used any time to receive the envelope status. Therefore, you simply call:

You can find a sample response for this call in the next section:

...

First you need the following api call to get the fileIds of the document (please note that this method is only for completed envelopes):


Code Block
languagejava
themeEclipse
titleREST Response
{
    "SentDocuments": [
        {
            "FileName": "test.pdf",
            "PageSizes": [
                {
                    "Width": 612.0,
                    "Height": 792.0
                }
            ]
        }
    ],
    "FinishedDocuments": [
        {
            "FileId": "806b89db-1234-1234-908b-4f2ba4ebd19e",
            "FileName": "test.pdf",
            "Attachments": []
        }
    ],
    "AuditTrail": {
        "FileId": "5e7b8aba-1234-1234-91f8-2c718bf913b1",
        "XmlFileId": "a10a1438-1234-1234-9799-16ae3ce54c37"
    },
    "Disclaimers": []
}

To download a finished document you can call the function:

Just insert one of the following file ids:

...