REST tutorial using SoapUI

This tutorial guides you through the process of making REST calls with the program SOAPUI. For detailed information about JSON and Postman: Please visit the Postman guide.

For more information about XML and SOAPUI: Please visit the SOAP guide.

Configuration

Let us start with the configuration within SOAP to define a new REST collection. Therefore, create a new REST project and import the Swagger. The next picture shows the configuration window and the link for the Swagger definition for https://demo.esignanywhere.net/:

Note: In this tutorial the version 4.0 is used. Please check if this version is still up to date (the most recent version).

You can copy this link: https://demo.esignanywhere.net/Api/swagger/docs/V4.0

After the import of the Swagger you should now see the api calls:

Api Calls

Version

The first api call will be the request “Version_Get”. Open this request like in the next picture and run it with the green arrow (top left). Then you should get an answer which is also shown in the next screenshot.

Authorization

For authentication, you’ll need an api token.

You can find this information in Settings / Api Tokens and Apps. Note that all API methods require authentication. Please note: 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.

You can also authorize with the organizationKey and the userLoginName.
Note: The organizationKey can also be found in Settings / Api Tokens and Apps

The organizationKey is the actual organization API key. The userLoginName is the actual login e-mail address.

There are two ways to define the parameters which are shown in the next figure:

FigureDescription

  1. Either add the parameter here (green plus symbol)
  2. or add the parameter here

You can see the configuration and the response in the next screenshot:

You have to select “Header” for this parameter. Furthermore, you will need this configuration of your authorization for all other api calls below.

Upload a file

For this call take any pdf which you want to upload. For this tutorial you can also use this one: eSignAnyWhere_Tutorial.pdf

First enter your authorization dates like we did in the authorization call. Afterwards, click on attachment and select the pdf file. Then you can run the call and get a SspFileId like it is shown in the next figure:

Send an envelope

For this call you need the file Id and a workstep configuration. You can find a sample configuration with one signature field (Click2Sign) and one recipient in the next collapse. You have to place this configuration in the text box as the next figure shows:

If you use the following workstep configuration you have to replace the placeholders ##EMAIL##, ##NAME## and ##File Id##.

{
  "SspFileIds": [
    "##File Id##"
  ],
  "SendEnvelopeDescription": {
 
 
  "Name": "test",
  "EmailSubject": "Please sign the enclosed envelope",
  "EmailBody": "Dear #RecipientFirstName# #RecipientLastName#\n\n#PersonalMessage#\n\nPlease sign the envelope #EnvelopeName#\n\nEnvelope will expire at #ExpirationDate#",
  "DisplayedEmailSender": "",
  "EnableReminders": true,
  "FirstReminderDayAmount": 5,
  "RecurrentReminderDayAmount": 3,
  "BeforeExpirationDayAmount": 3,
  "DaysUntilExpire": 28,
  "CallbackUrl": "",
  "StatusUpdateCallbackUrl": "",
  "Steps": [
    {
      "OrderIndex": 1,
      "Recipients": [
        {
          "Email": "##EMAIL##",
          "FirstName": "##NAME##",
          "LastName": "##NAME##",
          "LanguageCode": "en",
          "EmailBodyExtra": "",
          "DisableEmail": false,
          "AddAndroidAppLink": false,
          "AddIosAppLink": false,
          "AddWindowsAppLink": false,
          "AllowDelegation": true,
          "SkipExternalDataValidation": false,
          "AuthenticationMethods": []
        }
      ],
      "EmailBodyExtra": "",
      "RecipientType": "Signer",
      "WorkstepConfiguration": {
        "WorkstepLabel": "test",
        "SmallTextZoomFactorPercent": 100,
        "FinishAction": {
          "ServerActions": [],
          "ClientActions": [
          	

{
   "RemoveDocumentFromRecentDocumentList" : false,
            "CallClientActionOnlyAfterSuccessfulSync" : true,
            "ClientName" : "SIGNificant SignAnywhere",
            "CloseApp" : true,
            "Action" : "https://www.esignanywhere.net/"
}


          	
          	]
        },
        "ReceiverInformation": {
          "UserInformation": {
            "FirstName": "##NAME##",
            "LastName": "##NAME##",
            "EMail": "##EMAIL##"
          },
          "TransactionCodePushPluginData": []
        },
        "SenderInformation": {
          "UserInformation": {
            "FirstName": "##NAME##",
            "LastName": "##NAME##",
            "EMail": "##EMAIL##"
          }
        },
        "TransactionCodeConfigurations": [
          {
            
          }
        ],
        "SignatureConfigurations": [],
        "ViewerPreferences": {
          "FinishWorkstepOnOpen": false,
          "VisibleAreaOptions": {
            "AllowedDomain": "*",
            "Enabled": false
          }
        },
        "ResourceUris": {
          "DelegationUri": "https://demo.xyzmo.com//Resource/Delegate"
        },
        "AuditingToolsConfiguration": {
          "WriteAuditTrail": false,
          "NotificationConfiguration": {}
        },
        "Policy": {
          "GeneralPolicies": {
            "AllowSaveDocument": true,
            "AllowSaveAuditTrail": true,
            "AllowRotatingPages": false,
            "AllowEmailDocument": true,
            "AllowPrintDocument": true,
            "AllowFinishWorkstep": true,
            "AllowRejectWorkstep": true,
            "AllowRejectWorkstepDelegation": true,
            "AllowUndoLastAction": true,
            "AllowAdhocPdfAttachments": false,
            "AllowAdhocSignatures": false,
            "AllowAdhocStampings": false,
            "AllowAdhocFreeHandAnnotations": false,
            "AllowAdhocTypewriterAnnotations": false,
            "AllowAdhocPictureAnnotations": false,
            "AllowAdhocPdfPageAppending": false
          },
          "WorkstepTasks": {
            "PictureAnnotationMinResolution": 0,
            "PictureAnnotationMaxResolution": 0,
            "PictureAnnotationColorDepth": "Color16M",
            "SequenceMode": "NoSequenceEnforced",
            "PositionUnits": "PdfUnits",
            "ReferenceCorner": "Lower_Left",
            "Tasks": [
              {
                "PositionPage": 1,
                "Position": {
                  "PositionX": 68.0,
                  "PositionY": 606.0
                },
                "Size": {
                  "Height": 79.0,
                  "Width": 190.0
                },
                "AdditionalParameters": [
                  {
                    "Key": "enabled",
                    "Value": "1"
                  },
                  {
                    "Key": "positioning",
                    "Value": "onPage"
                  },
                  {
                    "Key": "req",
                    "Value": "1"
                  },
                  {
                    "Key": "fd",
                    "Value": ""
                  },
                  {
                    "Key": "fd_dateformat",
                    "Value": "dd-MM-yyyy HH:mm:ss"
                  },
                  {
                    "Key": "fd_timezone",
                    "Value": "datetimeutc"
                  }
                ],
                "AllowedSignatureTypes": [
                  {
                    "AllowedCapturingMethod": "Click2Sign",
                    "StampImprintConfiguration": {
                      "DisplayExtraInformation": true,
                      "DisplayEmail": true,
                      "DisplayIp": true,
                      "DisplayName": true,
                      "DisplaySignatureDate": true,
                      "FontFamily": "Times New Roman",
                      "FontSize": 11.0
                    },
                    "Id": "89a057d6-8e35-410f-84d3-e26cf93da175",
                    "DiscriminatorType": "SigTypeClick2Sign",
                    "Preferred": true
                  }
                ],
                "UseTimestamp": false,
                "IsRequired": true,
                "Id": "1#XyzmoDuplicateIdSeperator#Signature_5430c3b6-cc0d-26b1-86ea-3ba909701349",
                "DisplayName": "",
                "DocRefNumber": 1,
                "DiscriminatorType": "Signature"
              }
            ]
          }
        }
      },
      "DocumentOptions": [
        {
          "DocumentReference": "1",
          "IsHidden": false
        }
      ],
      "UseDefaultAgreements": true
    },
    {
      "OrderIndex": 2,
      "Recipients": [
        {
          "Email": "##EMAIL##",
          "FirstName": "##NAME##",
          "LastName": "##NAME##",
          "LanguageCode": "en",
          "EmailBodyExtra": "",
          "DisableEmail": false,
          "AddAndroidAppLink": false,
          "AddIosAppLink": false,
          "AddWindowsAppLink": false,
          "AllowDelegation": false,
          "SkipExternalDataValidation": false,
          "AuthenticationMethods": []
        }
      ],
      "EmailBodyExtra": "",
      "RecipientType": "Cc",
      "DocumentOptions": [],
      "UseDefaultAgreements": false
    }
  ],
  "AddFormFields": {
    "Forms": {}
  },
  "OverrideFormFieldValues": {
    "Forms": {}
  },
  "AttachSignedDocumentsToEnvelopeLog": false
}
}

If you use one of the following characters (ü, ö, ä or other special characters) in the workstep configuration, you may get the following error message:

Please change the encoding in the request properties to UTF-8 to prevent this error:


The next figure shows the configuration within SOAPUI:

Get the envelope

For this call you just have to add the envelope Id which you got from the last call. The next figure shows the configuration:

You get the full information about the envelope as response.