Skip to content

HLConnect/hlconnect-php

Repository files navigation

HLConnect

HL Connector provides a simplified API interface to Hal Leonard's Digital Asset Management (DAM) system. This API enables vendors to integrate with Hal Leonard's digital content distribution platform to purchase registrations, download, and manage digital sheet music and other media assets

Installation & Usage

Requirements

PHP 8.1 and later.

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/HLConnect/hlconnect-php.git"
    }
  ],
  "require": {
    "HLConnect/hlconnect-php": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/HLConnect/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure Bearer authorization: access_token
$config = HLConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new HLConnect\Api\AssetsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$pageSize = 20; // int | Number of assets to return per page
$lastId = 56; // int | The ID of the last asset from the previous page. Used for pagination to retrieve the next page of results.

try {
    $result = $apiInstance->assetsList($pageSize, $lastId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AssetsApi->assetsList: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to https://hlconnect-api.mu.se

Class Method HTTP request Description
AssetsApi assetsList GET /assets/list Retrieve a paginated list of digital assets
HealthApi health GET /health Perform system health check
PurchaseApi connectorPurchaseCancel DELETE /purchase/cancel Cancel purchase order line item
PurchaseApi connectorPurchaseDownloadUrl GET /purchase/download-url Get asset download URL
PurchaseApi connectorPurchaseInfo GET /purchase/info Retrieve purchase order information
PurchaseApi connectorPurchaseRegister POST /purchase/register Register a new purchase transaction
PurchaseApi connectorPurchaseViewUrl GET /purchase/view-url Get asset view URL
PurchaseCancelApi connectorPurchaseCancel DELETE /purchase/cancel Cancel purchase order line item
PurchaseDownloadUrlApi connectorPurchaseDownloadUrl GET /purchase/download-url Get asset download URL
PurchaseInfoApi connectorPurchaseInfo GET /purchase/info Retrieve purchase order information
PurchaseRegisterApi connectorPurchaseRegister POST /purchase/register Register a new purchase transaction
PurchaseViewUrlApi connectorPurchaseViewUrl GET /purchase/view-url Get asset view URL

Models

Authorization

Authentication schemes defined for the API:

access_token

  • Type: Bearer authentication

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 0.2
    • Package version: 0.0.1
    • Generator version: 7.18.0-SNAPSHOT
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen

About

PHP library for the HL Connect API

Resources

Stars

Watchers

Forks

Packages

No packages published