retailcrm / mg-bot-api-client-php
PHP client for MG Bot API
Installs: 2 528
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 5
Forks: 13
Open Issues: 0
Requires
- php: >=7.3
- ext-curl: *
- ext-json: *
- doctrine/annotations: ^1
- guzzlehttp/guzzle: 7.*
- jms/serializer: 3.*
- symfony/cache: 5.4.*|^6
- symfony/intl: 5.4.*|^6
- symfony/validator: 5.4.*|^6
Requires (Dev)
- phpmd/phpmd: 2.*
- phpstan/phpstan: 0.12.*
- phpunit/phpunit: ^9
- squizlabs/php_codesniffer: 3.4.*
- symfony/dotenv: 5.4.*
- dev-master / 1.x-dev
- v1.4.13
- v1.4.12
- v1.4.11
- v1.4.10
- v1.4.9
- v1.4.8
- v1.4.7
- v1.4.6
- v1.4.5
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.5
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.9
- v1.1.8
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.0
- dev-dialog-list-since-id-filter
- dev-php-env-and-version
- dev-add-note-field
- dev-extend-date-format
This package is auto-updated.
Last update: 2024-12-15 11:49:22 UTC
README
Message Gateway Bot API PHP client
Requirements
- PHP 7.3 and above
- PHP's cURL support
- PHP's JSON support
Install
-
Get composer
-
Run into your project directory:
composer require retailcrm/mg-bot-api-client-php ~1.*
If you have not used composer
before, include autoloader into your project.
require 'path/to/vendor/autoload.php';
Usage
Assign dialog
<?php use RetailCrm\Common\Exception; use RetailCrm\Mg\Bot\Client; use RetailCrm\Mg\Bot\Model\Request\DialogAssignRequest; $client = new Client('https://mg.url.demo', 'T9DMPvuNt7FQJMszHUd', true); try { $request = new DialogAssignRequest(); $request->setDialogId(60); $request->setUserId(4); /* @var \RetailCrm\Mg\Bot\Model\Response\AssignResponse $response */ $response = $client->dialogAssign($request); } catch (Exception\LimitException | Exception\InvalidJsonException | Exception\UnauthorizedException $exception) { echo $exception->getMessage(); } echo $response->getPreviousResponsible();