LogoSignature Service
Risk Management Toolbox

APIs

This chapter describes the APIs provided by the Risk Management Toolbox.

Validate document

POST /api/validation/

Headers

Content-Typeapplication/json

Body

dataString: PDF document, base64-encoded.
controlDataString: PDF control document, base64-encoded. Optional if none of the rule specified requires it
rulesSet<Rule>: Collection of rules that must be verified.
  idString: Rule ID.
  configurationString: A generic dictionary containing the rule's configuration.

Request Body Example

{
    "data" : "JVBERi0xLjMKJcTl8uXrp...",
    "controlData" : "JVBERi0xL3jam2x3o...",
    "rules":[
      {
        "id": "maxFileSize",
        "configuration": {
          "maxFileSize": "100KB"
        }
      },
      {
        "id": "pdfACompliance",
        "configuration": {
          "compliance": "1b"
        }
      },
      {
        "id": "visualComparison",
        "configuration": {
          "ignoreFormFields" : "true"
        }
      }
    ]
}

Response status code

200The validation has been executed successfully, see response body for result.
400The request or the configuration provided is invalid or incomplete.

Response body

successfulBoolean: Flag specifying if the validation is successful.
ruleExecutionsArray<RuleExecution>: Array of the executed rules:
  ruleIdString: Rule ID
  statusString: Execution status (PASSED | FAILED)
  violationsArray<RuleViolation>: Array of the violations for the given execution
    messageString: Violation message
    pageIndexInteger: Page index where the failure occurred (null if N/A)
reportString: Base64-encoded PDF report

Response Body Example

{
    "successful" : "false",
    "report" : "JVBERi0xLjMKJcTl8uXrp...",
    "ruleExecutions":[
      {
        "ruleId" : "fileReadable",
        "status" : "PASSED",
        "violations" : []
      },
      {
        "ruleId" : "maxFileSize",
        "status" : "FAILED",
        "violations" : [
          {
            "message" : "Document has exceeded the max file size (10000000 Bytes). Actual size : 12530300 Bytes",
            "pageIndex" : null
          }
        ]
      }
    ]
}

Validate document using a pre-configured profile

This API allow you to validate a document using an existing profile.

The profile are statically configured with a list of the rules to be executed and a default configuration. It's not necessary to specify rules defined in a profile in the request's body, unless its configuration needs to be overridden.

It is allowed to add new rule to the request that are not defined in the given profile.

API

POST /api/validation/profiles/{profileId}

Headers

Content-Typeapplication/json

Body

dataString: PDF document, base64-encoded.
rulesSet<Rule>: Collection of rules that must be verified.
  idString: Rule ID.
  configurationString: Additional configuration required for the rules. This configuration allows to override values pre-configured in the profile.

Request Body Example

{
    "data" : "JVBERi0xLjMKJcTl8uXrp...",
    "rules":[
      {
        "id": "maxFileSize",
        "configuration": {
          "maxFileSize": "100KB"
        }
      }
    ]
}

Response status code

200The validation has been executed successfully, see response body for result.
400The request or the configuration provided is invalid or incomplete
404The profileId is not valid

Response body

successfulBoolean: Flag specifying if the validation is successful.
ruleExecutionsArray<RuleExecution>: Array of the executed rules:
  ruleIdString: Rule ID
  statusString: Execution status (PASSED | FAILED)
  violationsArray<RuleViolation>: Array of the violations for the given execution
    messageString: Violation message
    pageIndexInteger: Page index where the failure occurred (null if N/A)
reportString: Base64-encoded PDF report

Response Body Example

{
    "successful" : "false",
    "report" : "JVBERi0xLjMKJcTl8uXrp...",
    "ruleExecutions":[
      {
        "ruleId" : "fileReadable",
        "status" : "PASSED",
        "violations" : []
      },
      {
        "ruleId" : "maxFileSize",
        "status" : "FAILED",
        "violations" : [
          {
            "message" : "Document has exceeded the max file size (10000000 Bytes). Actual size : 12530300 Bytes",
            "pageIndex" : null
          }
        ]
      }
    ]
}

On this page