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
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
NOTE: See the Base URL for PAS topic for more information.
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"
}
]
}
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.
Example
GET pas_base_url/v2/viewingPackages/unT67Fxekm8lk1p0kPnyg8/creator
NOTE: See the Base URL for PAS topic for more information.
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
DELETE /v2/viewingPackages/{documentId}
Deletes a viewing package and its associated content stored on disk.
Request
Example
DELETE pas_base_url/v2/viewingPackages/unT67Fxekm8lk1p0kPnyg8
NOTE: See the Base URL for PAS topic for more information.
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