Introduction
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:
- One is a WorkFile object that represents the source document whose text will be searched, and
- One or more Regular Expressions to match the document text.
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:
input
(Object) Input to create the RedactionCreator.documentFileId
(String) Required. The ID of the WorkFile that represents the source document whose text will be searched. This document will not be modified.autoRedactionRegularExpressions
(Array of strings) Required. The Regular Expressions to match within the source document text. Multiple Regular Expressions provided in the array will be concatenated into a single Regular Expression using the format: "(regex1)|(regex2)…|(regexN)".
minSecondsAvailable
(Integer) The minimum number of seconds which this RedactionCreator must remain available. If not provided, a configurable default value is used. This value is ignored if it is shorter than the configurable value.
Response Body
If successful, this method returns JSON containing the following properties:
input
(Object) Input we accepted to create the RedactionCreator.documentFileId
(String) The ID of the WorkFile that represents the source document whose text will be searched. This document will not be modified. This is an echo of what was passed in by the request.autoRedactionRegularExpressions
(Array of Strings) The Regular Expressions to match within the source document text. This is an echo of what was passed in by the request.
expirationDateTime
(String) The date and time (in ISO 8601 Extended Format) when the RedactionCreator will be deleted.processId
(String) The ID of the RedactionCreator.state
(String) The current state of the markup burning process running on the server. This will always be "processing" in this response.percentComplete
(Integer) The percentage (0 – 100) complete of the redaction creation process. This will always be 0 in this response.errorCode
(String) An error code string if a problem occurred during the markup burning process. This will always be null in this response.output
(Object)markupFileId
(String) The ID of the new WorkFile that represents the new redaction XML markup. This will always be null in this response.
affinityToken
(String) Affinity token for this search context. Present when clustering is enabled.
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:
input
(Object) Input we accepted to create the MarkupBurner.documentFileId
(String) The ID of the WorkFile that represents the source document whose text will be searched. This document will not be modified.autoRedactionRegularExpressions
(Array of Strings) The Regular Expressions to match within the source document text.
expirationDateTime
(String) The date and time (in ISO 8601 Extended Format) when the RedactionCreator will be deleted.processId
(String) The ID of the RedactionCreator.state
(String) The current state of the redaction creation process running on the server. The following values are allowed:"processing"
- The redaction creation is in progress."complete"
- The redaction creation is completed."error"
- The redaction creation returns an error.
percentComplete
(Integer) The percentage (0 – 100) complete of the redaction creation process.errorCode
(String) An error code string if a problem occurred during the redaction creation process.output
(Object)markupFileId
(String) The ID of the new WorkFile that represents a new XML Markup document specifying the redactions.
affinityToken
(String) Affinity token for this search context. Present when clustering is enabled.
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 the 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"
}