PrizmDoc v12.4 - Updated
Form Extractors

Form Extractors

The form extractors API allows you to detect form field elements in viewing session source documents.

A form extractor resource represents an asynchronous form extraction process. Each form extractor that is created is assigned a unique processId.

Available URLs

URL Description
GET /ViewingSession/u{viewingSessionId}/FormInfo Returns what kind of form field data, if any, is available in a viewing session's source document.
POST /v2/viewingSessions/{viewingSessionId}/formExtractors Creates a new form extractor from the source document of a viewing session, starting the process of extracting form field data.
GET /v2/viewingSessions/{viewingSessionId}/formExtractors/{processId} Gets the status and final output of a form extractor created for a specified viewing session.

Output Schemas

GET /ViewingSession/u{viewingSessionId}/FormInfo

Returns what kind of form field data, if any, is available in a viewing session's source document.

Request

URL Parameters

Parameter Description
{viewingSessionId} The viewingSessionId which identifies the viewing session. Note this particular URL requires a letter 'u' to be provided before the viewingSessionId.

Successful Response

Response Body

JSON with information about what kind of form data, if any, is available in the source document of the viewing session.

Error Responses

Status Code JSON errorCode Description
404 No viewing session with the provided {viewingSessionId} could be found.
480 "DocumentNotProvidedYet" A source document has not been provided to the viewing session.
501 "NotImplemented" Form extraction is not yet implemented for a viewing session which uses a cached viewing package.
580 "InternalError" The server encountered an internal error when handling the request.

Example

Request

GET /ViewingSession/uDLbVh9sTmXJAmd1GeXbS9Gn3WHxs8oib2xPsW2xEFjnIDdoJcudPtxciodSYFQq6zYGabQ_rJIecdbkImTTkSA/FormInfo

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "formType": ["acroform"]
}

POST /v2/viewingSessions/{viewingSessionId}/formExtractors

Creates a new form extractor from the source document of a viewing session, starting the process of extracting form field data.

Request

Request Headers

Name Description
Content-Type Must be application/json

Request Body

Successful Response

Response Body

JSON with metadata about the created form extractor process. You can check on the status of the form extraction process with additional GET requests.

Error Responses

Status Code JSON errorCode Description
480 "MissingInput" A required input value was not provided. See errorDetails in the response body.
480 "InvalidInput" An invalid input value was used. See errorDetails in the response body.
480 "DocumentNotProvidedYet" A source document has not been provided to the viewing session.
480 "FeatureNotLicensed" You are not licensed to use the form extraction feature.
501 "NotImplemented" Form extraction is not yet implemented for a viewing session which uses a cached viewing package.
580 "InternalError" The server encountered an internal error when handling the request.

Example

Request

POST /v2/viewingSessions/uDLbVh9sTmXJAmd1GeXbS9Gn3WHxs8oib2xPsW2xEFjnIDdoJcudPtxciodSYFQq6zYGabQ_rJIecdbkImTTkSA/formExtractors
Content-Type: application/json

{
  "input": {
    "formType": "acroform"
  }
}

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "input": {
    "formType": "acroform"
  },
  "processId": "ElkNzWtrUJp4rXI5YnLUgw",
  "state": "processing",
  "percentComplete": 0,
  "expirationDateTime": "2016-12-17T20:38:39.796Z"
}

GET /v2/viewingSessions/{viewingSessionId}/formExtractors/{processId}

Gets the status and final output of a form extractor created for a specified viewing session.

Request

URL Parameters

Parameter Description
{viewingSessionId} The viewingSessionId which identifies the viewing session.
{processId} The processId which identifies the form extractor process.

Successful Response

Response Body

JSON with metadata about the form extractor process and the final output, if available. You can check on the status of the form extraction process with additional GET requests.

Error Responses

Status Code JSON errorCode Description
404 No form extractor could be found for the given {viewingSessionId} and {processId}.
501 "NotImplemented" Form extraction is not yet implemented for a viewing session which uses a cached viewing package.
580 "InternalError" The server encountered an internal error when handling the request.

Examples

Request

GET /v2/viewingSessions/uDLbVh9sTmXJAmd1GeXbS9Gn3WHxs8oib2xPsW2xEFjnIDdoJcudPtxciodSYFQq6zYGabQ_rJIecdbkImTTkSA/formExtractors/x62gH3TYdqlKj94pLqzmtS

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "input": {
    "formType": "acroform"
  },
  "output": {
    "acroform": {
      "pages": [
        {
          "page": 1,
          "height": 792,
          "width": 612,
          "fields": [
            {
              "fieldType": "Text",
              "name": "email",
              "required": true,
              "tabOrder": 0,
              "appearance": {
                "textColor": "0 g",
                "font": "Helvetica"
              },
              "boundingBox": {
                "lowerLeftX": 89,
                "lowerLeftY": 646,
                "upperRightX": 239,
                "upperRightY": 668
              },
              "options": {
                "multiline": false,
                "maxLen": -1
              },
              "format": {
                "formatCategory": "None"
              }
            },
            {
              "fieldType": "Text",
              "name": "fullName",
              "required": false,
              "tabOrder": 1,
              "appearance": {
                "textColor": "0 g",
                "font": "Helvetica"
              },
              "boundingBox": {
                "lowerLeftX": 89,
                "lowerLeftY": 676,
                "upperRightX": 239,
                "upperRightY": 698
              },
              "options": {
                "multiline": false,
                "maxLen": -1
              },
              "format": {
                "formatCategory": "None"
              }
            }
          ]
        }
      ]
    }
  },
  "expirationDateTime": "2016-10-11T03:30:33.166Z",
  "percentComplete": 100,
  "processId": "x62gH3TYdqlKj94pLqzmtS",
  "state": "complete"
}

"acroform" Output

The output.acroform object will conform to the following. All properties are always present unless otherwise noted:

Fill Color Strings

A string of one or more numbers followed by an operator indicating what the numbers represent:

Date Format Strings

Date format strings use the following special substitution patterns:

All other characters are considered literal punctuation for the format string. The special characters used above may be used literally by escaping them with a backslash.

"rasterForm" Output

The output.rasterForm object will conform to the following. All properties are always present unless otherwise noted: