apiship/apidq-client-php

PHP client for ApiDQ API

Maintainers

πŸ‘ khalturinsky

Package info

github.com/apiship/apidq-client-php

Homepage

pkg:composer/apiship/apidq-client-php

Statistics

Installs: 6 515

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v3.0.1 2026-05-26 08:03 UTC

Suggests

Provides

None

Conflicts

None

Replaces

None

MIT 405610f8fd2800920ca5e15a044c9bb0990adf81

  • ApiShip <info.woop@apiship.ru>
  • Nikita Krasnikov <nikitaksv97.woop@gmail.com>

restapiclientsdkApidq

This package is auto-updated.

Last update: 2026-06-26 08:19:02 UTC


README

πŸ‘ Image

ApiDQ API PHP Client

πŸ‘ Latest Stable Version
πŸ‘ Total Downloads
πŸ‘ Latest Unstable Version
πŸ‘ License
πŸ‘ PHP Version Require
πŸ‘ codecov

This is the PHP ApiDQ API client. This library allows using of the actual API version. You can find more info in the documentation.

Installation

Follow those steps to install the library:

  1. Download and install Composer package manager.
  2. Install the library from the Packagist by executing this command:
composer require apiship/apidq-client-php:"~3.0"

Note: API client uses php-http/client-implementation as a PSR-18, PSR-17 implementation. You can replace those implementations during installation by installing this library with the implementation of your choice, like this:

composer require symfony/http-client guzzlehttp/psr7 apiship/apidq-client-php:"~3.0"

Usage

Firstly, you should initialize the Client. The easiest way to do this is to use the SimpleClientFactory:

$client = \ApiDQ\Factory\SimpleClientFactory::createClient('https://api.apidq.io', 'apiKey');
$client = \ApiDQ\Factory\SimpleClientFactory::createClientWithCache('https://api.apidq.io', 'apiKey', $psrCache);
$client = \ApiDQ\Factory\SimpleClientFactory::createClientWithFileCache('https://api.apidq.io', 'apiKey', sys_get_temp_dir());

The client is separated into several resource groups, all of which are accessible through the Client's public properties. You can call API methods from those groups like this:

$cleanResponse = $client->address->clean(
 (new \ApiDQ\Model\Service\Address\CleanRequest())
 ->setQuery('Москва')
 ->setCountryCode('RU')
);

To handle errors you must use two types of exceptions:

  • ApiDQ\Exception\Service\ServiceException for the api service error.
  • ApiDQ\Exception\Client\BuilderException for the client builder error.