PrizmDoc
Viewing Packages

Pre-Conversion Services developer preview

Pre-Conversion Services are included as a "Developer Preview." This feature is in late-stage development and api's marked as such should be used for evaluation purposes only and should not be used in production deployments. Note that these api's may undergo change prior to feature completion. The Pre-Conversion Services will be feature complete in PrizmDoc version 11.2. The Viewing Package Creator API provides a facility to fully convert a document for viewing prior to the creation of a Viewing Session. If a large document is converted for viewing at the time a Viewing Session is created, the user may experience a delay when viewing later pages in the document. By converting a document prior to viewing, the entire document is available for viewing immediately.

Viewing Packages

Note that these routes do not have route keys, as they cannot be re-routed.

GET /v2/viewingPackages/{documentId}

Headers:

After a viewing package creator process has been created, information about the converted content can be requested as shown in the example below:

Example

GET http://localhost:3000/v2/viewingPackages/unT67Fxekm8lk1p0kPnyg8

Successful Response:

200 OK
Content-Type: application/json
{
    "source": {
        "type": "document",
        "fileName": "sample.doc",
        "documentId": "unT67Fxekm8lk1p0kPnyg8"
    },
    "state": "complete",
    "packageExpirationDateTime": "2016-1-09T06:22:18.624Z",
    "pageFailures": [
        {
            "errorCode": "CouldNotProvideRasterContent",
            "pageNumber": "4"
        },
        {
            "errorCode": "CouldNotProvideSvgaContent",
            "pageNumber": "5"
        }
    ]
}

Errored Response:

If a GET request is made with either a missing or an invalid header Accusoft-Secret, an error similar to the one below will be returned.

403 InvalidSecret
Content-Type: application/json
{
    "errorCode": "InvalidSecret"
}

GET /v2/viewingPackages/{documentId}/creator

Headers:

This URL can provide a viewing package's creator process ID. A viewing package may outlive the process that created it, in which case a 404 response should be expected. When pre-converting viewing packages, the creator process ID is provided in response to the initial POST request. This URL is primarily useful to access to the creator process when creating a viewing session with caching enabled (when a documentId is provided) in which case the viewing package creator process is internally created by PrizmDoc Application Services.

Example

GET http://localhost:3000/v2/viewingPackages/unT67Fxekm8lk1p0kPnyg8/creator

Successful Response:

200 OK
Content-Type: application/json
{
    "viewingPackageCreatorId": "khjyrfKLj2g6gv8fdqg710"
}

Errored Responses:

If a request is made with an invalid viewing package ID or the creator process has expired, an error will be returned.

404 Not Found

If a GET request is made with either a missing or an invalid header Accusoft-Secret, an error similar to the one below will be returned.

403 InvalidSecret
Content-Type: application/json
{
    "errorCode": "InvalidSecret"
}

DELETE /v2/viewingPackages/{documentId}

Headers:

When the viewing package is no longer needed, a DELETE request to this URL will remove all content and delete the resource.

Example

DELETE http://localhost:3000/v2/viewingPackages/unT67Fxekm8lk1p0kPnyg8

Successful Response:

If a DELETE request is made the content will be marked for asynchronous deletion.

204 No Content

Errored Responses:

If a DELETE request is made with an invalid package ID, an error will be returned.

404 Not Found

If a DELETE request is made with either a missing or an invalid header Accusoft-Secret, an error similar to the one below will be returned.

403 InvalidSecret
Content-Type: application/json
{
    "errorCode": "InvalidSecret"
}

 

 


©2016. Accusoft Corporation. All Rights Reserved.

Send Feedback