Options
All
  • Public
  • Public/Protected
  • All
Menu

Contains all Requests connected with items

Hierarchy

  • BaseExtend
    • Asset

Index

Constructors

constructor

  • new Asset(config: ApiConfig, request: Request): Asset
  • Parameters

    • config: ApiConfig
    • request: Request

    Returns Asset

Properties

config

config: ApiConfig

request

request: Request

Methods

checkAccessForAsset

  • Checks whether a given authenticated user has access for an given item

    method

    checkAccessForAsset

    async
    example
    InPlayer.Asset.checkAccessForAsset(42597)
    .then(data => console.log(data));

    Parameters

    • id: number

      The id of created premium content in InPlayer Dashboard (i.e asset id).

    Returns Promise<AxiosResponse<GetItemAccessV1>>

    Contains the data:

    {
    id: number;
    account_id: number;
    customer_id: number;
    customer_uuid: string;
    ip_address: string;
    country_code: string;
    created_at: number;
    expires_at: number;
    item: {
    content: string;
    };
    }

getAccesCodeSessions

  • Gets sessions for the current browser

    method

    getAccesCodeSessions

    async
    example
    InPlayer.Asset
    .getAccesCodeSessions(429)
    .then(data => console.log(data));

    Parameters

    • codeId: number

      The id of code created for given premium content.

    Returns Promise<AxiosResponse<CodeAccessSessionsData[]>>

    Contains the data:

    [{
    agent_info: string;
    browser_fingerprint: string;
    code: string;
    code_id: string;
    last_used: number;
    }]

getAccessCode

  • Retrieves the access code and browser fingerprint for the current asset from localStorage Returns null if no access code is present

    method

    getAccessCode

    example

    const accessCode = InPlayer.Asset.getAccessCode(42925);

    Parameters

    • assetId: number

      The id of created premium content in InPlayer Dashboard (i.e asset id).

    Returns null | CodeAccessData | Promise<null | CodeAccessData>

    Contains the data:

    {
    item_id: number;
    content: string;
    in_use: boolean;
    browser_fingerprint: string;
    code: string;
    type: string;
    code_id: number;
    }

getAsset

  • getAsset(assetId: number, merchantUuid: string): Promise<AxiosResponse<ItemDetailsV1>>
  • Gets the item details for a given merchant item

    method

    getAsset

    async
    example
    InPlayer.Asset
    .getAsset(2,'a1f13-dd1dfh-rfh123-dhd1hd-fahh1dl')
    .then(data => console.log(data));

    Parameters

    • assetId: number

      The id of created premium content in InPlayer Dashboard (i.e asset id).

    • merchantUuid: string

      The Merchant's unique universal identifier (Merchant UUID). You can find it on the InPlayer's dashboard at the Account Details section as Account ID.

    Returns Promise<AxiosResponse<ItemDetailsV1>>

    Contains the data:

    {
    id: number;
    merchant_id: number;
    merchant_uuid: string;
    is_active: boolean;
    title: string;
    access_control_type: {
    id: number;
    name: string;
    auth: boolean;
    };
    item_type: {
    id: number;
    name: string;
    content_type: string;
    host: string;
    description: string;
    };
    age_restriction: {};
    metadata: [{}];
    created_at: number;
    updated_at: number;
    }

getAssetAccessFees

  • getAssetAccessFees(id: number): Promise<AxiosResponse<GetAccessFee>>
  • Get the access fees for a given item

    method

    getAssetAccessFees

    async
    example
    InPlayer.Asset
    .getAssetAccessFees(555)
    .then(data => console.log(data))

    Parameters

    • id: number

      The id of created premium content in InPlayer Dashboard (i.e asset id).

    Returns Promise<AxiosResponse<GetAccessFee>>

    Contains the data:

    {
    id: number;
    merchant_id: number;
    amount: number;
    currency: string;
    description: string;
    expires_at: number;
    starts_at: number;
    updated_at: number;
    created_at: number;
    access_type: {
    id: number;
    account_id: number;
    name: string;
    quantity: number;
    period: string;
    updated_at: number;
    created_at: number;
    };
    item: {
    id: number;
    merchant_id: number;
    merchant_uuid: string;
    active: boolean;
    title: string;
    access_control_type: {
    id: number;
    name: string;
    auth: boolean;
    };
    created_at: number;
    updated_at: number;;
    item_type: {
    id: number;
    name: string;
    content_type: string;
    host: string;
    description: string;
    };
    age_restriction: {};
    metadata: [{}];
    metahash?: {};
    content?: string;
    template_id: number;
    created_at: number;
    update_at: number;
    };
    trial_period: {
    quantity: number;
    period: string;
    description: string;
    };
    setup_fee: {
    id: number;
    fee_amount: number;
    description: string;
    };
    seasonal_fee: {
    id: number;
    access_fee_id: number;
    merchant_id: number;
    current_price_amount: number;
    off_season_access: boolean;
    anchor_date: number;
    created_at: number;
    updated_at: number;
    };
    external_fees: [{
    id: number;
    payment_provider_id: number;
    access_fee_id: number;
    external_id: string;
    merchant_id: number;
    }];
    geo_restriction: {
    id: number;
    country_iso: string;
    country_set_id: number;
    type: string;
    };
    current_phase: {
    access_fee_id: number;
    anchor_date: number;
    created_at: number;
    currency: string;
    current_price: number;
    expires_at: number;
    id: number;
    season_price: number;
    starts_at: number;
    status: string;
    updated_at: number;
    };
    }

getAssetsHistory

  • getAssetsHistory(size?: number, page?: number, startDate?: string, endDate?: string, type?: string): Promise<AxiosResponse<AssetsTransactions>>
  • Returns purchase history for different payment type

    method

    getAssetsHistory

    async
    example
    InPlayer.Asset
    .getAssetsHistory()
    .then(data => console.log(data))

    Parameters

    • size: number = 10

      The number of items per page. If it is not set the number of items per page will be 15.

    • page: number = 0

      The current page number. If it is not set the starting page will be returned.

    • Optional startDate: string

      The staring date filter.

    • Optional endDate: string

      The ending date filter.

    • Optional type: string

      The payment type filter. (i.e 'gift-payment', 'donation').

    Returns Promise<AxiosResponse<AssetsTransactions>>

    Contains the data:

    {
    collection: [{
    access_fee_description: string;
    action_type: string;
    charged_amount: number;
    client_id: string;
    consumer_email: string;
    consumer_id: number;
    continent: string;
    country: string;
    country_iso: string;
    created_at: string;
    currency_iso: string;
    device: {
    type: string;
    os: string;
    model: string;
    }
    donation_description: string;
    exchange_rate: number;
    expires_at: string;
    gateway_name: string;
    gift: {
    buyer_email: string;
    code: string;
    id: number;
    receiver_email: string;
    }
    ip_address: string;
    issued_by: number;
    item_access_id: number;
    item_id: number;
    item_title: string;
    item_type: string;
    merchant_id: number;
    note: string;
    payment_history_id: number;
    payment_method_name: string;
    payment_tool_info: string;
    payment_tool_token: string;
    referrer: string;
    settlement_currency: string;
    timestamp: number;
    transaction_token: string;
    trx_token: string;
    voucher_code: string;
    voucher_discount: string;
    }],
    total: number;
    unique_paying_customers: number;
    }

getCloudfrontURL

  • getCloudfrontURL(assetId: number, videoUrl: string): Promise<AxiosResponse<CloudfrontUrl>>
  • Returns a signed Cloudfront URL with the merchant's signature

    method

    getCloudfrontURL

    async
    example
    InPlayer.Asset
    .getCloudfrontURL(42599, 'url')
    .then(data => console.log(data));

    Parameters

    • assetId: number

      The id of created premium content in InPlayer Dashboard (i.e asset id).

    • videoUrl: string

      The video url

    Returns Promise<AxiosResponse<CloudfrontUrl>>

    Contains the data:

    {
    video_url: string;
    }

getDonationOptions

  • getDonationOptions(assetId: number): Promise<AxiosResponse<DonationDetails>>
  • Gets the donation options for the asset

    method

    getDonationOptions

    async
    example
    InPlayer.Donation
    .getDonationOptions(42597)
    .then(data => console.log(data));

    Parameters

    • assetId: number

      The id of created premium content in InPlayer Dashboard (i.e asset id).

    Returns Promise<AxiosResponse<DonationDetails>>

    Contains the data:

    {
    donations: [{
    id: number;
    item_id: number;
    amount: number;
    currency: string;
    description: string;
    }];
    donation_options: {
    id: number;
    item_id: number;
    custom_price_enabled: boolean;
    };
    }

getExternalAsset

  • getExternalAsset(assetType: string, externalId: string, merchantUuid?: string): Promise<AxiosResponse<ExternalItemDetails>>
  • Gets an external asset details

    method

    getExternalAsset

    async
    example
    InPlayer.Asset
    .getExternalAsset('ooyala','44237')
    .then(data => console.log(data));

    Parameters

    • assetType: string

      The type of the asset. Can be any of these values.

    • externalId: string

      The original video ID from the external OVP source (only for OVP asset type).

    • merchantUuid: string = ''

      The Merchant's unique universal identifier (Merchant UUID). You can find it on the InPlayer's dashboard at the Account Details section as Account ID.

    Returns Promise<AxiosResponse<ExternalItemDetails>>

    Contains the data:

    {
    access_fees: [
    {
    id: number;
    merchant_id: number;
    amount: number;
    currency: string;
    description: string;
    expires_at: number;
    starts_at: number;
    updated_at: number;
    created_at: number;
    access_type: {
    id: number;
    account_id: number;
    name: string;
    quantity: number;
    period: string;
    updated_at: number;
    created_at: number;
    };
    item: {
    id: number;
    merchant_id: number;
    merchant_uuid: string;
    active: boolean;
    title: string;
    access_control_type: {
    id: number;
    name: string;
    auth: boolean;
    };
    item_type: {
    id: number;
    name: string;
    content_type: string;
    host: string;
    description: string;
    };
    age_restriction: {
    min_age: number;
    };
    metadata?: [{}];
    metahash?: {};
    content?: string;
    template_id: number;
    created_at: number;
    update_at: number;
    };
    trial_period: {
    quantity: number;
    period: string;
    description: string;
    };
    setup_fee: {
    id: number;
    fee_amount: number;
    description: string;
    };
    seasonal_fee: {
    id: number;
    access_fee_id: number;
    merchant_id: number;
    current_price_amount: number;
    off_season_access: boolean;
    anchor_date: number;
    created_at: number;
    updated_at: number;
    };
    external_fees: [{
    id: number;
    payment_provider_id: number;
    access_fee_id: number;
    external_id: string;
    merchant_id: number;
    }];
    geo_restriction: {
    id: number;
    country_iso: string;
    country_set_id: number;
    type: string;
    };
    current_phase: {
    access_fee_id: number;
    anchor_date: number;
    created_at: number;
    currency: string;
    current_price: number;
    expires_at: number;
    id: number;
    season_price: number;
    starts_at: number;
    status: string;
    updated_at: number;
    };
    }
    ];
    metahash: {};
    }

getPackage

  • Get package info for a given Package ID

    method

    getPackage

    async
    example
    InPlayer.Asset
    .getPackage(4444)
    .then(data => console.log(data));

    Parameters

    • id: number

      The id of created package in InPlayer Dashboard.

    Returns Promise<AxiosResponse<GetMerchantPackage>>

    Contains the data:

    {
    total: number;
    page: number;
    offset: number;
    limit: number;
    collection: [{
    id: number;
    merchant_id: number;
    is_active: boolean;
    title: string;
    content: string;
    item_type: {
    id: number;
    name: string;
    content_type: string;
    host: string;
    description: string;
    };
    metadata: {};
    items: number;
    }];
    }

isFreeTrialUsed

  • isFreeTrialUsed(id: number): Promise<AxiosResponse<boolean>>
  • Checks whether Free trial has been used for a given item

    method

    isFreeTrialUsed

    async
    example
    InPlayer.Asset
    .isFreeTrialUsed(36320)
    .then(data => console.log(data));

    Parameters

    • id: number

      The id of created premium content in InPlayer Dashboard (i.e asset id).

    Returns Promise<AxiosResponse<boolean>>

requestCodeAccess

  • requestCodeAccess(__namedParameters: { code: string; item_id: number }): Promise<AxiosResponse<CodeAccessData>>
  • Gets access with code for code access grant asset

    method

    requestCodeAccess

    async
    throws

    Will throw an HTTP 400 error if the access code is already in use.

    throws

    Will throw an HTTP 401 error if the code is invalid.

    example
    InPlayer.Asset
    .requestCodeAccess({ assetId: 42599, code: 'access-code' })
    .then(data => console.log(data));

    Parameters

    • __namedParameters: { code: string; item_id: number }
      • code: string
      • item_id: number

    Returns Promise<AxiosResponse<CodeAccessData>>

    Contains the data:

    {
    item_id: number;
    content: string;
    in_use: boolean;
    browser_fingerprint: string;
    code: string;
    type: string;
    code_id: number;
    }

requestDataCaptureNoAuthAccess

  • requestDataCaptureNoAuthAccess(__namedParameters: { company: string; email: string; full_name: string; merchant_uuid: string }): Promise<AxiosResponse<CommonResponse>>
  • Gets access without authentication for asset with access control type data capture

    method

    requestDataCaptureNoAuthAccess

    async

    Parameters

    • __namedParameters: { company: string; email: string; full_name: string; merchant_uuid: string }
      • company: string
      • email: string
      • full_name: string
      • merchant_uuid: string

    Returns Promise<AxiosResponse<CommonResponse>>

    Contains the data:

    {
    code: 200,
    message: 'Access successfully granted'
    }

terminateSession

  • terminateSession(assetId: number): Promise<null | AxiosResponse<CommonResponse>>
  • Terminates session for the current browser

    method

    terminateSession

    async
    example
    InPlayer.Asset
    .terminateSession(42599)
    .then(data => console.log(data));

    Parameters

    • assetId: number

      The id of created premium content in InPlayer Dashboard (i.e asset id).

    Returns Promise<null | AxiosResponse<CommonResponse>>

    Contains the data:

    {
    code: 200,
    message: 'Successfully deleted session'
    }

Generated using TypeDoc