PrizmDoc v13.3 - Updated
Redaction Creator
API Reference > PrizmDoc Server RESTful API > Redaction Creator

Redaction Creator

The redaction creator is designed to get a redactions markup for text matching a Regular Expression. The redaction markup can be used with the markup burner API to "burn" the redactions into a document.

Available URLs

URL Description
POST /PCCIS/V1/RedactionCreator Creates and starts a new RedactionCreator.
GET /PCCIS/V1/RedactionCreator/{processId} Gets the state and result of an existing RedactionCreator.

POST /PCCIS/V1/RedactionCreator

Creates and starts a new RedactionCreator.

A RedactionCreator represents a process that runs on the server which searches a document for text matching a Regular Expression then, based on any matches, creates a new Markup XML document containing redaction markup. The redaction Markup XML that is created by this process can be used with the markup burner API to "burn" the redactions into a document.

The server process to create the redaction markup is started by this request, but a response is sent before the process is complete. Use the GET /PCCIS/V1/RedactionCreator/{processId} URL below to get the state and results of an in-progress or completed RedactionCreator process.

There are two required inputs to create a RedactionCreator:

See the work file API topic for more information about a WorkFile.

A new Markup XML document will be created that will contain the redaction markup. The new document will be made available by a new WorkFile ID.

By default, RedactionCreator objects will be automatically deleted 20 minutes after they are created.

Request

Request Headers

Name Description
Content-Type Must be application/json
Accusoft-Affinity-Token The affinityToken of the work file specified by input.documentFileId. Required when server clustering is enabled.

Request Body

In the request body, provide JSON containing the following properties:

Response Body

If successful, this method returns JSON containing the following properties:

Error Responses

Status Code Description
400 Bad Request, if input.documentFileId, input.autoRedactionRegularExpressions is missing or invalid format, or if minSecondsAvailable is not a number.
405 Method Not Allowed, if POST HTTP method is not used.

Examples

Request

POST prizmdoc_server_base_url/PCCIS/V1/RedactionCreator
Content-Type: application/json
Accusoft-Affinity-Token: ejN9/kXEYOuken4Pb9ic9hqJK45XIad9LQNgCgQ+BkM=

{
    "input": {
        "documentFileId": "ek5Zb123oYHSUEVx1bUrVQ",
        "autoRedactionRegularExpressions": [
            "[0-9]{3}[-]?[0-9]{2}[-]?[0-9]{4}"
        ]
    },
    "minSecondsAvailable": 60
}

Response

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

{
    "input": {
        "documentFileId": "ek5Zb123oYHSUEVx1bUrVQ",
        "autoRedactionRegularExpressions": [
            "[0-9]{3}[-]?[0-9]{2}[-]?[0-9]{4}"
        ]
    },
    "expirationDateTime": "2014-12-17T20:38:39.796Z",
    "processId": "ElkNzWtrUJp4rXI5YnLUgw",
    "affinityToken": "ejN9/kXEYOuken4Pb9ic9hqJK45XIad9LQNgCgQ+BkM=",
    "state": "processing",
    "percentComplete": 0,
    "errorCode": null,
    "output": null
}

GET /PCCIS/V1/RedactionCreator/{processId}

Gets the state and result of an existing RedactionCreator.

Requests can be sent to thus URL repeatedly while state is "processing".

When state is "complete", the new markup XML document containing redactions will be made available by a new WorkFile ID in the output.markupFileId. See the work file API topic to find out how to download a WorkFile.

If the markup burning process encountered an error, the state property will be "error", the errorCode property will contain an error code string and output will be null.

Request

Request Headers

Name Description
Content-Type Must be application/json
Accusoft-Affinity-Token The affinityToken of the work file specified by input.documentFileId. Required when server clustering is enabled.

URL Parameters

Parameter Description
{processId} The id of the process.

Response Body

If successful, this method returns JSON containing the following properties:

Error Responses

Status Code Description
404 Not Found, if {processId} does not exist.
405 Method Not Allowed, if GET HTTP method is not used.

Examples

Request

GET prizmdoc_server_base_url/PCCIS/V1/RedactionCreator/ElkNzWtrUJp4rXI5YnLUgw
Accusoft-Affinity-Token: ejN9/kXEYOuken4Pb9ic9hqJK45XIad9LQNgCgQ+BkM=

Response when the state is "processing"

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

{
    "input": {
        "documentFileId": "ek5Zb123oYHSUEVx1bUrVQ",
        "autoRedactionRegularExpressions": [
            "[0-9]{3}[-]?[0-9]{2}[-]?[0-9]{4}"
        ]
    },
    "expirationDateTime": "2014-12-17T20:38:39.796Z",
    "processId": "ElkNzWtrUJp4rXI5YnLUgw",
    "affinityToken": "ejN9/kXEYOuken4Pb9ic9hqJK45XIad9LQNgCgQ+BkM=",
    "state": "processing",
    "percentComplete": 0,
    "errorCode": null,
    "output": null
}

Response when the state is "complete"

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

{
    "input": {
        "documentFileId": "ek5Zb123oYHSUEVx1bUrVQ",
        "autoRedactionRegularExpressions": [
            "[0-9]{3}[-]?[0-9]{2}[-]?[0-9]{4}"
        ]
    },
    "expirationDateTime": "2014-12-17T20:38:39.796Z",
    "processId": "ElkNzWtrUJp4rXI5YnLUgw",
    "affinityToken": "ejN9/kXEYOuken4Pb9ic9hqJK45XIad9LQNgCgQ+BkM=",
    "state": "complete",
    "percentComplete": 100,
    "errorCode": null,
    "output": {
        "markupFileId": "vry3FPE0zQqYwhzndRccOQ"
    }
}

Response when the state is "error" because the work file that represents source document whose text will be searched could not be found

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

{
    "input": {
        "documentFileId": "ek5Zb123oYHSUEVx1bUrVQ",
        "markupFileId": "aQ1BdViqmUisBuevJKO9Sw"
    },
    "expirationDateTime": "2014-12-17T20:38:39.796Z",
    "processId": "ElkNzWtrUJp4rXI5YnLUgw",
    "affinityToken": "ejN9/kXEYOuken4Pb9ic9hqJK45XIad9LQNgCgQ+BkM=",
    "state": "error",
    "percentComplete": 0,
    "errorCode": "DocumentFileIdDoesNotExist"
}