netzfabrik/netzfabrik-php-api

dev-main 2023-06-12 08:03 UTC

This package is not auto-updated.

Last update: 2024-12-24 13:46:15 UTC


README

PHP client library for the NETZFABRIK API

For more information, please visit https://www.netzfabrik.com.

Installation & Usage

Requirements

PHP 7.4 and later. Should also work with PHP 8.0.

Composer

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

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/NETZFABRIKCOM/netzfabrik-php-api.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/netzfabrik-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: JWT
$config = NETZFABRIK\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = NETZFABRIK\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new NETZFABRIK\Api\AccountApi(
    // 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
);
$id = 'id_example'; // string | Account identifier

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

API Endpoints

All URIs are relative to http://localhost

Models

Authorization

Authentication schemes defined for the API:

JWT

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

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

info@netzfabrik.com

About this package

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

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