PrizmDoc Viewer v13.19 - Updated
API Reference / PAS REST API / Application Development / Viewing Packages
In This Topic
    Viewing Packages
    In This Topic

    Introduction

    The viewing packages REST API allows your application to manage existing viewing packages.

    To create a new viewing package, use the viewing package creators REST API or provide a documentId when creating a viewing session.

    Available URLs

    URL Description
    GET /v2/viewingPackages/{documentId} Gets info about a viewing package.
    GET /v2/viewingPackages/{documentId}/creator Gets the processId of the viewingPackageCreator which created this viewing package if it still exists.
    DELETE /v2/viewingPackages/{documentId} Deletes a viewing package and its associated content stored on disk.

    GET /v2/viewingPackages/{documentId}

    Gets info about a viewing package.

    Request

    Request Headers

    Name Description
    Accusoft-Secret Required only if you are self-hosting PAS, must match the value of secretKey in your PAS config file.

    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 pas_base_url/v2/viewingPackages/unT67Fxekm8lk1p0kPnyg8
    

    Successful Response

    HTTP/1.1 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": "CouldNotRetrieveJpegContent",
                "pageNumber": "4"
            },
            {
                "errorCode": "CouldNotRetrieveSvgaContent",
                "pageNumber": "5"
            }
        ]
    }
    
    

    Error Responses

    If you are self-hosting PAS and a GET request does not include the correct Accusoft-Secret header value, you will receive an error like the one below. See PAS Configuration for more info about configuring your PAS secretKey.

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

    GET /v2/viewingPackages/{documentId}/creator

    Gets the processId of the viewingPackageCreator which created this viewing package if it still exists.

    This URL is useful when you create a viewing session with a documentId (allowing PAS to automatically start a viewingPackageCreator for you in the background if no viewing package exists yet) and you want to check the status of the viewingPackageCreator which PAS may have created on your behalf. After creating a viewing session with a documentId, you can use this URL to see if any associated viewingPackageCreator exists. If it does, you can then use the returned viewingPackageCreatorId to GET more info about the status of the viewingPackageCreator that PAS started for you.

    Request Headers

    Name Description
    Accusoft-Secret Required only if you are self-hosting PAS, must match the value of secretKey in your PAS config file.

    Example

    GET pas_base_url/v2/viewingPackages/unT67Fxekm8lk1p0kPnyg8/creator
    

    Successful Response

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

    Error Responses

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

    HTTP/1.1 404 Not Found
    
    

    If you are self-hosting PAS and a GET request does not include the correct Accusoft-Secret header value, you will receive an error like the one below. See PAS Configuration for more info about configuring your PAS secretKey.

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

    DELETE /v2/viewingPackages/{documentId}

    Deletes a viewing package and its associated content stored on disk.

    Request

    Request Headers

    Name Description
    Accusoft-Secret Required only if you are self-hosting PAS, must match the value of secretKey in your PAS config file.

    Example

    DELETE pas_base_url/v2/viewingPackages/unT67Fxekm8lk1p0kPnyg8
    

    Successful Response

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

    HTTP/1.1 204 No Content
    
    

    Error Responses

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

    HTTP/1.1 404 Not Found
    
    

    If you are self-hosting PAS and a DELETE request does not include the correct Accusoft-Secret header value, you will receive an error like the one below. See PAS Configuration for more info about configuring your PAS secretKey.

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