Skip to content

LODGEA/lodgea-php

Repository files navigation

lodgea-php

LODGEA SDK for php. Check out https://docs.lodgea.io for more information.

Installation & Usage

Requirements

PHP 7.3 and later. Should also work with PHP 8.0 but has not been tested.

Composer

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

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

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

Getting Started

Please follow the installation procedure and then run the following:

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



// Configure API key authorization: ApiKeyAuth
$config = com.lodgea\Configuration::getDefaultConfiguration()->setApiKey('apiKey', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = com.lodgea\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer');


$apiInstance = new com.lodgea\Api\DefaultApi(
    // 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
);
$inline_object1 = new \com.lodgea\com.lodgea.model\InlineObject1(); // \com.lodgea\com.lodgea.model\InlineObject1

try {
    $result = $apiInstance->availabilitySearchPost($inline_object1);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->availabilitySearchPost: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to https://api.eu.lodgea.io/v1

Class Method HTTP request Description
DefaultApi availabilitySearchPost POST /availability/search Search for availability
DefaultApi locationSearchPost POST /location/search Search for location
DefaultApi propertiesGet GET /properties List (filtered) properties
DefaultApi propertiesPropertyIdAvailabilityGet GET /properties/{propertyId}/availability Get a properties availability
DefaultApi propertiesPropertyIdGet GET /properties/{propertyId} Get a properties details

Models

Authorization

ApiKeyAuth

  • Type: API key
  • API key parameter name: apiKey
  • Location: HTTP header

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

[email protected]

About this package

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

  • API version: 1.2.0
    • Package version: 1.2.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen