holidaylink/api-sdk-php

HolidayLink.com PHP SDK for API

Maintainers

Package info

github.com/holidaylink/holidaylink-sdk-php

Issues

pkg:composer/holidaylink/api-sdk-php

Statistics

Installs: 191

Dependents: 0

Suggesters: 0

Stars: 0

dev-master 2017-03-07 10:01 UTC

This package is auto-updated.

Last update: 2026-02-27 09:33:18 UTC


README

This repository contains Holiday-Link.com PHP SDK and samples for our API

Prerequisites

  • PHP 5.3 or above
  • curl extension must be enabled
  • json extension must be enabled
  • composer for fetching dependencies (See http://getcomposer.org)

Samples

Usage

To write an app that uses the SDK

  • add holidalink/api-sdk-php to your composer.json require list or copy the [sample/composer.json] (sample/composer.json) to your project's root
  • run composer update to fetch dependencies
  • obtain API credentials from Holiday-Link.com
  • now you are all set to make your first API call
$apiCredentials = new \HolidayLink\Auth\Credentials($config['access-token]);

try {
    $params = array(
      'expand' => 'field1, field2, field3',
    );
    $entity = Entity::allFromXML($params, $apiCredentials);
} catch (Exception $ex) {
    echo 'Exception:', $ex->getMessage(), PHP_EOL;
    exit(1);
}

print_r($entity->toArray());