Skip to content
Last updated

Signed contracts

Create signed contract

To create a signed contract, use the following endpoint: POST /api/SignedContract

Input

//POST /api/SignedContract
{
  "contractGroupGuid": "d8b7fcd1-e607-4099-8d66-f27884dddb77",
  "externalID": "d8b7fcd1-e607-4099-8d66-f27884dddb77",
  "userIp": "string",
  "environment": 0,
  "templateVariant": "My variant name",
  "screenshot": "string",
  "clauses": [
    {
      "tag": "my_tag",
      "accepted": true
    }
  ],
  "fieldCollection": {
    "name": "name",
    "surname": "surname"
  }
}
FieldDescription
ContractGroupGuidContract group GUID connected to the signed contract
ExternalIdThe key used in your software that represents the user
UserIpThe IP address
Environment0: staging, 1: production
TemplateVariantThe name of the template variant to use when generating the signed contract PDF file. If not provided, the "Default variant" will be used
ScreenshotByte array of an image corresponding to the contract. If the contract feature "Capture Screenshot" isn't enabled, this value will be ignored
ClausesThe list of conditions set in the contract:
TagThe tag associated with the condition
AcceptedAcceptance status of a single condition
FieldCollectionA JSON where the recipient information is saved; the elements key must mirror what is saved in the contract Form Elements

Output

{
  "guid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "contract": {
    "version": "string",
    "enviroment": 0,
    "groupGuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "nameOfContract": "string"
  },
  "fieldCollection": "string",
  "signedContractDate": "2023-05-04T08:15:39.268Z",
  "platform": "string",
  "userIdentifier": "string",
  "clauses": [
    {
      "tag": "my_tag",
      "accepted": true
    }
  ],
  "contractHash": "string",
  "externalID": "string",
  "signedContractGroupGuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "userIp": "string",
  "contractGuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
FieldDescription
GuidThe auto generated signed contract guid
ContractThe contract linked to the signed contract:
VersionThe version of the contract
Environment0 = staging, 1 = production
GroupGuidUnique identifier that binds all the versions of a specific contract
NameOfContractName of the contract
FieldCollectionThe same collection as input
SignedContractDateCreation date of the signed contract
PlatformPlatform on which the consent is created (API)
UserIdentifierIdentifier of the user who has given the consent; it is automatically extracted from field collection if there's a field named "email" or "mail" or "e-mail", otherwise it will be saved as string empty
ClausesThe same collection as input
ContractHashThe hash that will be sent on the blockchain
ExternalIDThe same as input
SignedContractGroupGuidAuto generated guid
UserIpThe IP of the user that created the signed contract
ContractGuidThe guid of the contract linked to the signed contract

Get signed contracts

To get the signed contracts, use the following endpoint: POST /api/SignedContract/List

Input

//POST /api/SignedContract/List
{
  "contractGroupGuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "externalID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "userIdentifier": "string",
  "dateFrom": "2020-04-01T00:00:00.0000000",
  "dateTo": "2030-04-01T00:00:00.0000000",
  "platform": "string",
  "enviroment": 0,
  "version": "string",
  "getScreenshot": true,
  "page": 1,
  "itemsPerPage": 20
}
FieldDescription
ContractGroupGuidIf set, retrieves the signed contract related to this specific contract group guid
ExternalIdIf set, retrieves the signed contracts related to this specific ExternalId
UserIdentifierIf set, retrieves the signed contracts related to this UserIdentifier
DateFromIf set, retrieves the signed contracts created starting from this date
DateToIf set, retrieves the signed contracts created up to this date
PlatformIf set, retrieves the signed contracts of this specific platform
EnviromentIf set, retrieves signed contracts of a specific environment (0: staging, 1: production)
VersionIf set, retrieves signed contracts related to a specific version
PagePagination purpose, it must be > 0
ItemsPerPagePagination purpose, it must be > 0, it sets the number of elements retrieved by page

The only required parameters are page and itemsPerPage.
The result collection doesn't include signed contracts related to deleted contracts.
The result is a list of signed contracts.

Output

[
  {
    "guid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "contract": {
      "version": "string",
      "enviroment": 0,
      "groupGuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "nameOfContract": "string"
    },
    "fieldCollection": "string",
    "signedContractDate": "2023-05-04T13:23:08.277Z",
    "platform": "string",
    "userIdentifier": "string",
    "clauses": [
      {
        "tag": "string",
        "accepted": true
      }
    ],
    "blockchainProcessId": "string",
    "blockchainTxHash": "string",
    "contractHash": "string",
    "blockchainStatus": 0,
    "blockchainStatusDate": "2023-05-04T13:23:08.277Z",
    "externalID": "string",
    "blockchainUuid": "string",
    "pdf": "string",
    "signedContractGroupGuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "contractGuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "userIp": "string",
    "screenshot": "string"
  }
]
FieldDescription
GuidThe auto generated signed contract guid
ContractThe contract linked to the signed contract
Contract.VersionThe version of the contract
Contract.Enviroment0 = staging, 1 = production
Contract.GroupGuidUnique identifier that binds all the versions of a specific contract
Contract.NameOfContractName of the contract
FieldCollectionThe JSON given as input
SignedContractDateCreation date of the signed contract
PlatformPlatform on which the signed contract is created (Windows, Android, Macintosh, iPhone, iPad, BlackBerry, CrOS, Linux, Symbian, Others)
UserIdentifierIdentifier of the user
ClausesThe same collection as input
BlockchainProcessIdThe ID of the process on the blockchain
BlockchainTxHashThe final hash that represents the success save on the blockchain
ContractHashThe hash that will be sent on the blockchain
BlockchainStatusSave status on the blockchain (Registered = 0, Queued = 1, ProcessCreated = 2, Notarized = 3, Error = 4)
BlockchainStatusDateWhen the status of the save on the blockchain changes
ExternalIDThe same as input
BlockchainUuidUUID generated by the blockchain
SignedContractGroupGuidThe signed contract group guid
ContractGuidThe GUID of the contract linked to the signed contract
UserIpThe IP of the user that created the signed contract
ScreenshotThe screenshot of the signed contract if present and if...

Get signed contract PDF

To get the signed contract PDF document use the following endpoint:

GET /api/SignedContract/GetSignedContract/{signedContractGuid}

Output

The signed contract PDF file

Get audit trail PDF

To get the audit trail PDF document, use the following endpoint:

GET /api/SignedContract/GetAuditTrail/{signedContractGuid}

Output

The Audit Trail PDF file