Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

This section describes BSS communication with AminoTV License v4 API. Products and user licenses are manageable through License Management API

The license management API consist of two parts: licenses management and products management.

Entities

License resource

Typical license resource may look like the one below and it consists of 3 parts.

Code Block
languagetext
themeMidnight
titleLicense resource
collapsetrue
{
  "id": "42",
  "type": "License",
  "attributes": {
    "status": "ACTIVE",
    "start_date": 1523268666,
    "stop_date": 1523268698,
    "order_id": "1adc0dbe-3c65-4248-896c-78c049e276c8",
    "renew_record": {
      "recurring": true,
      "expiry_date": 1523268698
    },
    "purchase_record": {
      "price_currency_amount": 1223,
      "price_currency_iso4217": "EUR",
      "purchase_timestamp": 1526648593,
      "payment_method": "credit card"
    }
  },
  "relationships": {
    "user": {
      "data": {
        "id": "41",
        "type": "User"
      }
    },
    "product": {
      "data": {
        "id": "41",
        "type": "Product"
      }
    }
  }
}

Resource identification:

  • id - unique license resource identifier - auto generated value, this value is used when operating over license
  • type - resource type, must be 'License' 

Attributes:

status - current license status, could be one of [PROCESSING, CHECK_INVALID, ORDER_ERROR, ACTIVE, EXPIRED, SUSPENDED, SUSPENDEDADMIN]:
  • ACTIVE - this is the only status which allows end-user to watch the content license was created for, it is default status for newly created o licenses
  • SUSPENDED - license was suspended by client through BSS or by AminoTV support via CMS
  • SUSPENDEDADMIN - license was suspended by AminoTV script
  • EXPIRED - license life time expired, managed by AminoTV scripts
  • ORDER_ERROR, CHECK_INVALID, PROCESSING - are internal statuses for matching orders with external systems (Hybris SAP)


    Introduction

    This section describes BSS communication with AminoTV License v4 API. Products and user licenses are manageable through License Management API

    The license management API consist of two parts: licenses management and products management.

    Entities

    License resource

    Typical license resource may look like the one below and it consists of 3 parts.

    Code Block
    languagetext
    themeMidnight
    titleLicense resource
    collapsetrue
    {
      "id": "42",
      "type": "License",
      "attributes": {
        "status": "ACTIVE",
        "start_date": 1523268666,
        "stop_date": 1523268698,
        "order_id": "1adc0dbe-3c65-4248-896c-78c049e276c8",
        "renew_record": {
          "recurring": true,
          "expiry_date": 1523268698
        },
        "purchase_record": {
          "price_currency_amount": 1223,
          "price_currency_iso4217": "EUR",
          "purchase_timestamp": 1526648593,
          "payment_method": "credit card"
        }
      },
      "relationships": {
        "user": {
          "data": {
            "id": "41",
            "type": "User"
          }
        },
        "product": {
          "data": {
            "id": "41",
            "type": "Product"
          }
        }
      }
    }

    Resource identification:

    • id - unique license resource identifier - auto generated value, this value is used when operating over license
    • type - resource type, must be 'License' 

    Attributes:

    • status - current license status, could be one of [PROCESSING, CHECK_INVALID, ORDER_ERROR, ACTIVE, EXPIRED, SUSPENDED, SUSPENDEDADMIN]:
      • ACTIVE - this is the only status which allows end-user to watch the content license was created for, it is default status for newly created o licenses
      • SUSPENDED - license was suspended by client through BSS or by AminoTV support via CMS
      • SUSPENDEDADMIN - license was suspended by AminoTV script
      • EXPIRED - license life time expired, managed by AminoTV scripts
      • ORDER_ERROR, CHECK_INVALID, PROCESSING - are internal statuses for matching orders with external systems (Hybris SAP)
    • start_date - timestamp when the license should become active
    • stop_date - timestamp when the license will expire
    • order_id - field used to store client generated order id, also used by internal scripts when purchacing/prolonging licenses with 3rd party services
    • renew_record.recurring - with setting this attribute client can specify should the license be auto renewable or not, if the attribute omitted then value from associated product used.
    • renew_record.expiry_date - expiration date of the licenses, if the renew_record.recurring attribute set to true then licenses renewal scripts will rely on this attribute to select licenses to process
    • purchase_record.price_currency_amount - price of the license in cents, if this is not provided the value from associated product will be used
    • purchase_record.price_currency_iso4217 - currency of the license price, if this is not provided the value from associated product will be used
    • purchase_record.purchase_timestamp - timestamp to set license purchase date, this could be useful when license created separately on client side and then added to system, if no value provided then current timestamp will be used
    • purchase_record.payment_method - the method license was payed with, as we do not support any billing system clients should manage payments processing by themselves and can just pass any convenient string here. Please note that for users license API payment method 'billing' will be used by default.

    Product resource




    Authorization

    All BSS endpoints support API key authorization. The header named 'Authorization' with content "Apikey PUT_YOUR_KEY_HERE" must be passed with request.

    Licenses management

    Fetch licenses

    Endpoints overview

    Id

    Endpoint

    HTTP method

    Purpose

    GetLicenses/api/license/management/v4/licensesGETFetch list of licenses with filters
    GetLicenseById/api/license/management/v4/licenses/{license_id}GETGet license specified by id
    GetLicensesByUser/api/license/management/v4/users/{user_id}/licensesGETGet all user licenses

    BSS can get list of licenses with filters, all user licenses and single license. GetLicenses and GetLicenseById calls return an array of licenses with all relationships and also contain included section with all products associated to fetched licenses. GetLicenseById will return single license resource and associated product in included section.



    Create licenses

    Id

    Endpoint

    HTTP method

    Purpose

    CreateLicense/api/license/management/v4/licensesPOSTGrant license on specified product to user

    Delete licenses

    Id

    Endpoint

    HTTP method

    Purpose

    DeleteLicenseById/api/license/management/v4/licenses/{license_id}DELETEDelete license by id

    Batch operations

    Id

    Endpoint

    HTTP method

    Purpose

    BatchCreateLicenses/api/license/management/v4/licenses/batch_createPOSTCreate multiple licenses
    BatchDeleteLicenses/api/license/management/v4/licenses/batch_deletePOSTDelete multiple licenses

    Products management

    Fetch products

    Id

    Endpoint

    HTTP method

    Purpose

    GetAllProducts/api/license/management/v4/productsGETGet all product
    GetProductById/api/license/management/v4/products/{product_id}GETGet product bu Id

    Create products

    Id

    Endpoint

    HTTP method

    Purpose

    CreateProduct/api/license/management/v4/productsPOSTCreate new product

    Update products

    Id

    Endpoint

    HTTP method

    Purpose

    UpdateProduct/api/license/management/v4/products/{product_id}PATCHUpdate product attributes

    Delete products

    Id

    Endpoint

    HTTP method

    Purpose

    DeleteProductById/api/license/management/v4/products/{product_id}DELETEDelete product by id

    Use cases


    Migration from legacy


    DRM provers support

    Irdeto

    Table of Contents