...
In this tutorial you will do the first API call as well as sending envelopes, upload documents and download signed papers. Let us start with creating a collection so that we can save all requests there.
Figure | Steps |
---|
Image Modified
| Steps:- Go to register "new"
- Select "Collection"
|
Create a request
After creating a new Collection, we will save our first request into it.
Figure | Description |
---|
Image Modified
| Steps:- Go to register "new"
- Select "request"
- Choose a name and save the request in the collection
|
Authentication
The next request will show you an authorization. This is an important part of the requests for sure but not only because of security but also because we will need the authorization for all following requests.
...
Please see the next sample authorization (Bearer token):
Key | Value |
---|
"Authorization" | "Bearer asdfngtmvv8pfmsuaxpzz85zux3e63dd9zttrwitx9mln6qka6tds83du3p3lroe" |
Please see the next sample authorization (api token):
Key | Value |
---|
"ApiToken" | "asdfngtmvv8pfmsuaxpzz85zux3e63dd9zttrwitx9mln6qka6tds83du3p3lroe" |
You can find this information in Settings / Api Tokens and Apps. Note that all API methods require an authentication. The API token is a user specific secret which should not be shared with other users. We recommend to create different API keys for different application integrations, to avoid configuring the same key in various integration systems. This allows, e.g. in case of sharing a key by mistake, to disable one key while keeping other integrations working with their existing configuration.
...
Let us start now with the first API call. As the name of our request tells we will first make an easy call to examine the current version.
![image2022-7-12_14-55-13.png](/plugins/servlet/confluence/placeholder/unknown-attachment?locale=en_GB&version=2)
Upload a file
Note |
---|
It is not allowed to upload multiple files at once (when more files are selected). |
Before we can send an envelope, we must make sure that we have already uploaded a file. Therefore, the next request will be about uploading a file.
![image2022-7-25_11-6-42.png](/plugins/servlet/confluence/placeholder/unknown-attachment?locale=en_GB&version=2)
Figure | Description |
---|
Image Modified
| Steps:- Set the request type to POST
- Set the URI: https://demo.esignanywhere.net/Api/v6/file/upload
- Add a file in the section "Body" form-data
- Add the authentication (Api Token) in the header
Response Code Block |
---|
| {
"FileId": "8a4fd938-1234-1234-9866-f0fe466781d3"
} |
Please note: The FileId is needed for the next api call. |
Sending an envelope
Send the first envelope with the document you have chosen from the upload call.
...
and paste it in the body of the sending request. Then change from “none” to “raw” and change the File ID to the one you get from the upload file request.
![image2022-7-25_11-7-4.png](/plugins/servlet/confluence/placeholder/unknown-attachment?locale=en_GB&version=2)
Figure | Description |
---|
Image Modified
| Steps:- Set the request type to POST
- Set the URI: https://demo.esignanywhere.net/Api/v6/envelope/send
- Add the envelope configuration in "Body" (sample configuration below)
- Please change the type to "raw"
- Change the "Text" to JSON format
- Add the authentication (Api Token) in the header
Response Code Block |
---|
| {
"EnvelopeId": "1393adcf-1234-1234-9173-aba385426549"
} |
Please note: The EnvelopeId is needed for the next api call. |
The following sample configuration contains two recipients with the following workflow:
...
Code Block |
---|
|
{
"Documents": [
{
"FileId": "8a4fd938-1234-1234-842a-be1e1d472b1c",
"DocumentNumber": 1
}
],
"Name": "Test",
"Activities": [
{
"Action": {
"Sign": {
"RecipientConfiguration": {
"ContactInformation": {
"Email": "janedoe@sample.com",
"GivenName": "Jane",
"Surname": "Doe"
}
},
"Elements": {
"Signatures": [
{
"TaskConfiguration": {
"OrderDefinition": {
"OrderIndex": 1
}
},
"IdElementId": "sample sig click2sign",
"Required": true,
"DocumentNumber": 1,
"DisplayName": "Sign here",
"AllowedSignatureTypes": {
"ClickToSign": {}
},
"FieldDefinition": {
"Position": {
"PageNumber": 1,
"X": 100,
"Y": 200
},
"Size": {
"Width": 100,
"Height": 70
}
}
}
]
},
"SigningGroup": "firstSigner"
}
}
},
{
"Action": {
"SendCopy": {
"RecipientConfiguration": {
"ContactInformation": {
"Email": "johndoe@sample.com",
"GivenName": "John",
"Surname": "Doe"
}
}
}
}
}
]
} |
...
Before downloading the documents we need the file Ids. Therefore the following api call is necessary:
![image2022-7-25_11-11-57.png](/plugins/servlet/confluence/placeholder/unknown-attachment?locale=en_GB&version=2)
Figure | Description |
---|
Image Modified
| Steps:- Set the request type to GET
- Set the URI: https://demo.esignanywhere.net/Api/v6/envelope/{envelopeId}/files
- Add the authentication (Api Token) in the header
Response Code Block |
---|
| {
"Documents": [
{
"FileId": "78b271f2-1234-1234-1234-3799951b1d54",
"FileName": "Test.pdf",
"Attachments": [],
"PageCount": 1,
"DocumentNumber": 1
}
],
"AuditTrail": {
"FileId": "7a86456c-1234-1234-1234-032757afa88e",
"XmlFileId": "dc60dcd4-1234-1234-1234-8828c79a2c88"
},
"Disclaimers": []
} |
Here you can see all three Ids for the documents which can be downloaded. |
After this call just add the Ids in the following api call URI and download the documents:
![image2022-7-25_11-16-48.png](/plugins/servlet/confluence/placeholder/unknown-attachment?locale=en_GB&version=2)
How to use variables in Postman
...