Download the PHP package plhw/hf-api-client without Composer
On this page you can find all versions of the php package plhw/hf-api-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download plhw/hf-api-client
More information about plhw/hf-api-client
Files in plhw/hf-api-client
Package hf-api-client
Short Description PLHW API Client provides means to authenticate clients against with OAuth2 server and issue authorized requests to our api endpoints
License proprietary
Informations about the package hf-api-client
PLHW Api Client
PLHW API Client provides means to authenticate clients against our OAuth2 server and issue authorized requests to our api endpoints.
Installation
Example API calls
Once you have succesfully installed the application, some example scripts are located at. To use them first copy an configuration file to your app root.
Open .hf-api-client-secrets.php
and configure it with credentials you got from us.
Finally the example scripts are configured to use data/cache
as directory for its cached accss tokens. This directory must exist (only for the examples).
Now you can run the example scripts;
Usage
To implement usage in your application you can have a look at the example scripts.
The above is all that is nessesary to configure, though I recommend you tweak the caching meganism. Currently we use the zendframework/zend-cache component. This might change when v3 is released to use the psr-7 caching FIG standard.
When you have ApiClient
instance you can use it by calling methods as defined in /vendor/plhw/hf-api-client/data/v1
on it. Additionally API documentation can be found here.
for example, search the published practices around a coordinate.
Under the hood
When you call any method on the APIClient instance an access token is requested from our OAuth2 server. This access token is then cached for aditional uses up to the moment it expires or is deleted. It will then get a new access token.
Any calls to our API are now signed
with that access token and is used by our permission system to determain if you have access or not.
Our API will accept and return json payload with are automaticly (de)encoded.
OAuth2 ClientCredentialsGrant
For machine to machine communication OAuth2 ClientCredentialGrant is appropiate. You must obtain the following information from us.
- client ID
- client secret
- scope
Your client side application should communicate via a proxy to our server.
Run all examples in the 'commerce' domain:
Upgrading
v2 has been rewritten for php 8+. Principals are the same but there are a few minor changes that will break your application.
Please see our examples to see how you interact with the api.
All versions of hf-api-client with dependencies
beberlei/assert Version ^3.3
fig/http-message-util Version ^1.1
laminas/laminas-cache Version ^3.0
laminas/laminas-cache-storage-adapter-filesystem Version ^2.0
laminas/laminas-http Version ^2.14
laminas/laminas-serializer Version ^2.10
league/oauth2-client Version ^2.6
ocramius/package-versions Version ^2.1
ramsey/uuid Version ^4.1
symfony/var-dumper Version ^5.3