Skip to content

Latest commit

 

History

History
182 lines (130 loc) · 12.9 KB

File metadata and controls

182 lines (130 loc) · 12.9 KB

DrmConfigurations

Overview

Available Operations

  • list - Get list of DRM configuration IDs
  • get - Get DRM configuration by ID

list

This endpoint retrieves the DRM configuration (DRM ID) associated with a workspace. It returns a list of DRM configurations, identified by a unique DRM ID, which is used for creating DRM encrypted asset.

How it works:

  1. Make a GET request to this endpoint.
  2. Optionally use the offset and limit query parameters to paginate through the list of DRM configurations.
  3. The response includes a list of DRM IDs and pagination metadata.

Example:
A media service provider may retrieve DRM configuration for a workspace to create DRM content.

Related guide: Manage DRM configuration

Example Usage

import { Fastpix } from "@fastpix/fastpix-node";

const fastpix = new Fastpix({
  security: {
    username: "your-access-token",
    password: "your-secret-key",
  },
});

async function run() {
  const result = await fastpix.drmConfigurations.list({});

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { FastpixCore } from "@fastpix/fastpix-node/core.js";
import { drmConfigurationsList } from "@fastpix/fastpix-node/funcs/drmConfigurationsList.js";

// Use `FastpixCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const fastpix = new FastpixCore({
  security: {
    username: "your-access-token",
    password: "your-secret-key",
  },
});

async function run() {
  const res = await drmConfigurationsList(fastpix, {});
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("drmConfigurationsList failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetDrmConfigurationRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.GetDrmConfigurationResponse>

Errors

Error Type Status Code Content Type
errors.FastpixDefaultError 4XX, 5XX */*

get

This endpoint retrieves a DRM configuration ID. It is used to fetch the DRM-related ID for a workspace, typically required when validating or applying DRM policies to video assets.

How it works:

  1. Make a GET request to this endpoint, replacing {drmConfigurationId} with the UUID of the DRM configuration.
  2. The response contains the associated DRM configuration ID.

Related guide: Manage DRM configuration

Example Usage

import { Fastpix } from "@fastpix/fastpix-node";

const fastpix = new Fastpix({
  security: {
    username: "your-access-token",
    password: "your-secret-key",
  },
});

async function run() {
  const result = await fastpix.drmConfigurations.get({
    drmConfigurationId: "your-drm-configuration-id",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { FastpixCore } from "@fastpix/fastpix-node/core.js";
import { drmConfigurationsGet } from "@fastpix/fastpix-node/funcs/drmConfigurationsGet.js";

// Use `FastpixCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const fastpix = new FastpixCore({
  security: {
    username: "your-access-token",
    password: "your-secret-key",
  },
});

async function run() {
  const res = await drmConfigurationsGet(fastpix, {
    drmConfigurationId: "your-drm-configuration-id",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("drmConfigurationsGet failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetDrmConfigurationByIdRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.GetDrmConfigurationByIdResponse>

Errors

Error Type Status Code Content Type
errors.FastpixDefaultError 4XX, 5XX */*