Download the PHP package samsonasik/apigility-consumer without Composer
On this page you can find all versions of the php package samsonasik/apigility-consumer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package apigility-consumer
ApigilityConsumer
Laminas API Tools Client module to consume API Services.
This is README for version ^4.0 which only support php ^8.0 with laminas-servicemanager v3 and laminas-json v3.
For version ^3.0 you can read at version 3 readme which only support php ^7.1 with laminas-servicemanager v3 and laminas-json v3.
For version ^2.0, you can read at version 2 readme which only support php ^7.1 with zend-servicemanager v3 and zend-json v3.
For version 1, you can read at version 1 readme which still support php ^5.6|^7.0 with zend-servicemanager v2.
Consider upgrading :)
Installation
Installation of this module uses composer.
For its configuration, copy vendor/samsonasik/apigility-consumer/config/apigility-consumer.local.php.dist
to config/autoload/apigility-consumer.local.php
and configure with your api host url (required), oauth, and/or http auth settings:
Then, enable it :
Using at Mezzio
You can use at Mezzio, after set up local config/autoload/apigility-consumer.local.php
like above, you can copy config/mezzio.local.php.dist
to config/autoload/mezzio.local.php
, and you can use it.
Services
1. ApigilityConsumer\Service\ClientAuthService
It used for oauth
, with usage:
Specify Oauth "client_id"
You can specify what client_id to be used on Http Auth with provide withClient()
:
Reset Oauth "client_id"
We can re-use the client service and use back default "client_id" with resetClient()
:
2. ApigilityConsumer\Service\ClientService
For general Api Call, with usage:
a. General RAW Json data
b. With Upload file
You can also do upload with it to upload file to API Service. For example:
With include Http (basic or digest) Authentication
if api call require authentication for basic or digest, you can apply ->withHttpAuthType()
:
that will read of specified basic or digest auth config we defined at config/autoload/apigility-consumer.local.php
.
If you want to specify custom username and password for the Http Auth on callAPI()
call, you can specify via $data
:
Specify "client_id" on Http Auth
On Http Auth, there is no "client_id" definition concept. On ClientService
, they are keys that represent just like "client_id" to ease switch client specific http auth.
To allow You can specify what "client_id" to be used on Http Auth with provide withClient()
:
Reset "client_id" Http Auth
We can re-use the client service and use back default "client_id" with resetClient()
:
Reset Http Auth Type
After one or both HttpClient::AUTH_BASIC
or HttpClient::AUTH_DIGEST
used, we can re-use the client service and use back normal API Call without Http Authentication with apply ->resetHttpAuthType()
:
Client Result of callAPI() returned usage
The $clientResult
will be a ApigilityConsumer\Result\ClientResult
or ApigilityConsumer\Result\ClientAuthResult
instance, with this instance, you can do:
Contributing
Contributions are very welcome. Please read CONTRIBUTING.md
All versions of apigility-consumer with dependencies
laminas/laminas-http Version ^2.14
laminas/laminas-json Version ^3.2
laminas/laminas-servicemanager Version ^3.6
laminas/laminas-stdlib Version ^3.3