alexander.corrochano / php_wemust_driver
Web driver interface for request to Wemust API
This package's canonical repository appears to be gone and the package has been frozen as a result.
v1.1
2020-08-24 02:39 UTC
Requires
- php: ^7.4.0
Requires (Dev)
- ext-xdebug: *
- phpunit/php-code-coverage: *
- phpunit/phpunit: ^9.2
This package is auto-updated.
Last update: 2023-07-14 04:51:35 UTC
README
Installation
To install this driver, run the command below and you will get the latest version.
composer require alexander.corrochano/php_wemust_driver
How to use it
Bellow you can find an example of use. Don't forget to use your own credentials.
$requestFactory = new RequestFactory(
$baseUrl, // Base url where Wemust API is deployed
$serviceCode, // The name of your app that must be register in Wemust API
$clientID, // The ID of your app (provided by wemust operator)
$clientSecret // The secret of your app (provided by wemust operator)
);
$requestService = new RequestService();
$requestManager = new RequestManager($requestService);
$wemust = new WemustAPI($requestFactory, $requestManager);
$response = $wemust('GetUserInfoByName', ['username' => 'ancalexander']);
$status = $response->getStatus(); // return 1 if there is no errors
$data = $response->getData(); // return an array with all data reported by Wemust API