magdv/cargo-php-api-client

REST-Full API для логистической биржи cargomart.ru

2.1.2 2025-01-21 17:13 UTC

README

REST-Full API для логистической биржи cargomart.ru

Installation & Usage

Requirements

PHP 7.2 and later.

Composer

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

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/magdv/cargo-php-api-client.git"
    }
  ],
  "require": {
    "magdv/cargo-php-api-client": "*@dev"
  }
}

Then run composer install

Your project is free to choose the http client of your choice Please require packages that will provide http client functionality: https://packagist.org/providers/psr/http-client-implementation https://packagist.org/providers/php-http/async-client-implementation https://packagist.org/providers/psr/http-factory-implementation

As an example:

composer require guzzlehttp/guzzle php-http/guzzle7-adapter http-interop/http-factory-guzzle

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/OpenAPIClient-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: CookieTokenAuth
$config = MagDv\Cargomart\Configuration::getDefaultConfiguration()->setApiKey('token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MagDv\Cargomart\Configuration::getDefaultConfiguration()->setApiKeyPrefix('token', 'Bearer');

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


$apiInstance = new MagDv\Cargomart\Api\AclvepTApi(
    // If you want use custom http client, pass your client which implements `Psr\Http\Client\ClientInterface`.
    // This is optional, `Psr18ClientDiscovery` will be used to find http client. For instance `GuzzleHttp\Client` implements that interface
    new GuzzleHttp\Client(),
    $config
);

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

API Endpoints

All URIs are relative to https://cargomart.ru

Models

Authorization

HeaderAuthorizationAuth

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

CookieTokenAuth

  • Type: API key
  • API key parameter name: token
  • Location:

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

support@cargomart.ru

About this package

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

  • API version: 2.0
    • Generator version: 7.11.0-SNAPSHOT
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen