PrizmDoc Viewer v13.24 Release - Updated August 22, 2023
API Reference / PrizmDoc Video REST API / Media
Media

Media

The Media REST API is used to download and upload videos for viewing in PrizmDoc Viewer.

Available URLs

URL Description
GET /api/v1/media/:fileId/video Downloads the video for viewing.
POST /api/v1/media Uploads the video for viewing.

GET /api/v1/media/:fileId/video

Downloads the video for viewing.

Parameter

Field Type Description
fileId String File ID returned from /api/v1/media.

Query Parameter(s)

Field Type Description
AffinityToken String Affinity Token returned on upload (only when PrizmDoc is in cluster mode).

Success 200

Field Type Description
body ReadableStream Byte stream of the video uploaded to /api/v1/media.

Success-Response

HTTP/1.1 200 OK
<video file bytes>

Error 4xx

Name Description
NotFound The fileID specified in the URL path was not found.

Error-Response

HTTP/1.1 404 Not Found
{ }

POST /api/v1/media

Uploads the video for viewing.

Header

Field Type Description
Content-Type String Mime type of file. Expected to be one of video/mp4, video/webm, video/ogg, application/octet-stream.

Request Body

Field Type Description
Body ArrayBuffer Video file bytes.

Success 200

Field Type Description
fileID String Identifier associated with uploaded file.
affinityToken String Identifier indicating the PrizmDoc Server instance that processed the request (only when running PrizmDoc Server in cluster mode).

Success-Response

HTTP/1.1 200 OK
{
  "fileId": "zgOGNBUIjfRHF2g4SNz1_A"
}

Success-Response with Affinity Token

HTTP/1.1 200 OK
{
  "fileId": "zgOGNBUIjfRHF2g4SNz1_A",
  "affinityToken":"zTfGFeeRXKxPF5o4HgnFFgZ6YU6bcbvMsJdJciYJemo="
}

Error 4xx

Name Description
FeatureNotLicensed The file exceeds evaluation limit of 5MB.
MissingInput Content-Type header is missing.
InvalidInput Content-Type header is not a valid value.

480 FeatureNotLicensed

HTTP/1.1 413 FeatureNotLicensed
{
  "errorCode": "FeatureNotLicensed",
  "errorDetails": {
    "in": "body",
    "at": "length",
    "expected": {
      "lessThanOrEqualTo": 5242880
    }
  }
}

480 MissingInput

HTTP/1.1 480 MissingInput
{
  "errorCode": "MissingInput",
  "errorDetails": {
    "in": "headers",
    "at": "Content-Type",
    "expected": {
      "oneOf": [
        {
          "value": "video/mp4"
        },
        {
          "value": "video/webm"
        },
        {
          "value": "video/ogg"
        },
        {
          "value": "application/octet-stream"
        }
      ]
    }
  }
}

480 InvalidInput

HTTP/1.1 480 InvalidInput
{
  "errorCode": "InvalidInput",
  "errorDetails": {
    "in": "headers",
    "at": "Content-Type",
    "expected": {
      "oneOf": [
        {
          "value": "video/mp4"
        },
        {
          "value": "video/webm"
        },
        {
          "value": "video/ogg"
        },
        {
          "value": "application/octet-stream"
        }
      ]
    }
  }
}