Create a new Transaction

This topic will walk you through the process to create and send a transaction using the ValidSign API.

In this example a minimum payload is used, where two signers, one document, and one signature per signer are added to the package.

For a complete description of each field and other optional attributes, see Request Payload Table. You can also refer to the Interactive API for more information.

Create a one step package

Create a one step package

The following instruction describles how to create a ValidSign Package using your own application.

HTTP Request
============
POST /api/packages

HTTP Headers
============
Authorization: Basic api_key / Bearer access_token
Accept: application/json

Request Payload
============
------WebKitFormBoundary1bNO60n7FqP5WO4t
Content-Disposition: form-data; name="file"; filename="testDocument.pdf"
Content-Type: application/pdf
%PDF-1.5
%µµµµ
1 0 obj
<>>>
endobj.... 
------WebKitFormBoundary1bNO60n7FqP5WO4t
Content-Disposition: form-data; name="payload"	
{
"roles":[
    {
        "id":"Signer1",
        "signers":[
            {
                "email":"signer1@example.com",
                "firstName":"Firstname",
                "lastName":"Lastname"
            }
        ]
    },
    {
        "id":"Signer2",
        "signers":[
            {
                "email":"signer2@example.com",
                "firstName":"Firstname",
                "lastName":"Lastname"
            }
        ]
    }
],
"documents":[
    {
        "name": "Example Document",
        "extract": true,
        "extractionTypes": [
            "TEXT_TAGS"
        ]
    }
],
"name":"Example Package",
"type":"PACKAGE",
"language":"en",
"autocomplete":true,
"status":"SENT"
}
------WebKitFormBoundary1bNO60n7FqP5WO4t--
DocumentPackage documentPackage = newPackageNamed("Example Package")
.withSigner(newSignerWithEmail("signer1@example.com")
   .withCustomId("Signer1")
   .withFirstName("Firstname")
   .withLastName("Lastname")) 
.withSigner(newSignerWithEmail("signer2@example.com")
   .withCustomId("Signer2")
   .withFirstName("Firstname")
   .withLastName("Lastname"))
.withDocument(newDocumentWithName("Example Document")
   .fromFile("your_file_path")
   .withExtractionType(ExtractionType.TEXT_TAGS)
   .enableExtraction())
.build();

PackageId packageId = eslClient.createPackageOneStep(documentPackage);
eslClient.sendPackage(packageId);
FileStream fs = File.OpenRead("your_file_path");

DocumentPackage documentPackage = PackageBuilder
.NewPackageNamed("Example Package")
.WithSettings(DocumentPackageSettingsBuilder.NewDocumentPackageSettings())
.WithSigner(SignerBuilder.NewSignerWithEmail("signer1@example.com")
   .WithFirstName("Firstname")
   .WithLastName("Lastname")
   .WithCustomId("Signer1"))
.WithSigner(SignerBuilder.NewSignerWithEmail("signer2@example.com")
   .WithFirstName("Firstname")
   .WithLastName("Lastname")
   .WithCustomId("Signer2"))
.WithDocument(DocumentBuilder.NewDocumentNamed("Example Document")
   .FromStream(fs, DocumentType.PDF)
   .WithExtractionType(ExtractionType.TEXT_TAGS)
   .EnableExtraction())
.Build();
 
PackageId packageId = ossClient.CreatePackageOneStep(documentPackage);
ossClient.SendPackage(packageId);

Create packages using Postman

Introduction

To create a ValidSign package using Postman is very simple! Please follow the steps in the description below to create your first package via Postman.

New Postman Request

First, let's start to create a new Postman Request.

  1. Click on the + sign to create a new request
  2. Select the POST method
  3. Insert the ValidSign endpoint https://my.validsign.eu/api/packages

 

Setup header authentication

Within this example we are using the API Key to connect.

  1. Click on the headers tab from the existing request
  2. Add a key called "Authorization"
  3. Set the value as "Basic YOUR_API_KEY"

Change the value YOUR_API_KEY with the API Key what is set on your account.

Set the body

Within this example we are using the example payload as set within the chapter "Create packages using API". This payload is supporting the ValidSign Text-Tags what will automatically create the signature fields on the document.

To set the correct body, do the following steps:

  1. Click the body tab within the existing Postman request
  2. Choose the option "form-data"
  3. Create a new key called "payload"
  4. Set the value to the json example
  5. Create a new key called "file"
  6. Hover with you mouse over the key, and change the type to "File" instead of "Text"
  7. Within the value field, click on the "Select Files" button
  8. Choose the example document from your device
  9. Hit the Send button

 

Example documents

Download the example documents below to create your transactions via Postman.

Download JSON request

Download Example Document

When your ValidSign is registrerd on your email address, please use a different email address for testing. When the sender (your email) is also a signer, the RoleID should be set to "Owner" instead of Signer1, Signer2 etc.