Skip to content
Last updated

Proof type JSON format

No-code proof types are stored in a package's /json/proof directory. There should be one .json file in this directory for each proof type that is visible to the Hypersync app user.

Each proof type file exposes a JSON object with these properties:

Property
Required?
Description
descriptionYesThis is the description of the proof type.
criteriaYesThis is an array of criteria fields that are required by the proof type.
proofSpecYesAn object that specifies how the proof type should be rendered.
overridesNoThese are proof specs that override the base proof spec based on a particular condition.

criteria

The criteria property is an array of JSON objects. Each element in the array represents a criteria field that the user must specify when configuring the proof type. If a proof type does not require any criteria, the criteria property should be defined as an empty array.(i.e. []).

Each object in the array has two required properties: name and page:

Property
Description
nameThis identifies the criteria field in the criteria provider.
pageA zero-based index of the page on which the criterion should be shown.

proofSpec

The proofSpec property is a JSON object that specifies how the proof type should be rendered.

Property
Required?
Description
periodYesDetermines the default synchronization schedule. Acceptable values are daily, weekly, monthly, quarterly, and yearly.
useVersioningYesDetermines whether or not to use versioning by default.
suggestedNameYesDetermines the suggested name for new Hypersyncs using this proof type.
formatYesThe format of the fields on the page. Acceptable values are tabular (fields that are side by side) and stacked (fields stacked vertically)
orientationYesFor PDF proof types. This property determines the orientation of the generated PDF. Acceptable values are portrait and landscape.
titleYesDetermines the text to be rendered at the top of the generated proof.
subtitleYesDetermines the text to be rendered below the title.
dataSetYesDetermines the name of the dataset to which the proof type is bound.
dataSetParamsNoThe parameters provided to the data source when retrieving the dataset.
noResultsMessageNoDetermines the text to be rendered if no items are found in the dataset.
fieldsYesAn array of fields to include with the generated proof.
webPageUrlNoThe URL shown at the bottom of the generated proof.
autoLayoutNoDetermines if the fields within the specification are automatically laid out. Acceptable values are true and false. The default value is false.

overrides

The overrides property is optional and allows you to define alternative proof specs that replace the default proof spec under certain conditions.

For example, if you have a criteria field that lets the user select a group by name — and that control includes an “All Groups” option — you can use an override to change the layout of the generated proof when the user selects “All Groups".

When specified, the overrides property must be an array of objects. Each object must include two properties:

  • condition — Defines when the override should apply.
  • proofSpec — Specifies the proof spec to use when the condition is met.

Example

{
  "description": "{{messages.PROOF_TYPE_USER_LIST}}",
  "criteria": [{ "name": "group", "page": 0 }],
  "proofSpec": {
    "period": "monthly",
    "useVersioning": true,
    "suggestedName": "{{messages.PROOF_TYPE_USER_LIST}}",
    "format": "tabular",
    "orientation": "landscape",
    "title": "{{messages.CONNECTOR_NAME}}",
    "subtitle": "{{messages.PROOF_TYPE_USER_LIST}}",
    "dataSet": "users",
    "dataSetParams": {
      "group": "{{criteria.group}}"
    },
    "noResultsMessage": "{{messages.NO_USERS}}",
    "fields": [
      {
        "property": "firstName",
        "label": "{{messages.LABEL_FIRST_NAME}}",
        "width": "400px",
        "type": "text"
      },
      {
        "property": "lastName",
        "label": "{{messages.LABEL_LAST_NAME}}",
        "width": "400px",
        "type": "text"
      },
      {
        "property": "email",
        "label": "{{messages.LABEL_EMAIL_ADDRESS}}",
        "width": "200px",
        "type": "text"
      },
      {
        "property": "status",
        "label": "{{messages.LABEL_STATUS}}",
        "width": "200px",
        "type": "text"
      }
    ],
    "webPageUrl": "https://myservice.com/users"
  }
}