Download the PHP package hscore/hsapi without Composer
On this page you can find all versions of the php package hscore/hsapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package hsapi
Short Description REST api for B2B partners of Hifi Station Kft.
License MIT
Informations about the package hsapi
HSApi
In Hifi Station Kft we decided to create a new automation system for our B2B partners. You can connect your webshop, ecommerce, or any other system to our API.
We won't be able to write your backend code but we will help you to create the connection.
The api does not support OpenCart/Magento/PrestaShop/WooCommerce/Unas/Shoprenter/etc. You need to write your own code to connect to your system.
Requirements
- PHP 7.4
- Composer
- ext-openssl: *
- ext-simlexml: *
- ext-json: *
Features
- List products with informations
- Secure authentication (HTTP Basic Auth + API Key)
- JSON/XML REST output
Installation
"hscore/hsapi": "*"
or run
composer require hscore/hsapi
Note that the vendor folder and the vendor/autoload.php script are generated by Composer; they are not part of the api.
Alternatively, if you're not using Composer, you can download HSApi as a zip file, then copy the contents of the HSApi folder into one of the include_path directories specified in your PHP configuration and load class file manually:
Authentication
In order to use the API you need to authenticate. You can do this by using the authenticate
method.
We prepared a simlified authentication method.
You can use the authentication credentails in the following way:
https://api.hifi-station.hu/v2/products?username=USERNAME&password=PASSWORD&api_key=API_KEY
In the email that we send you after a successful registration copy the data and change the UPPERCASE strings.
You can change the output (JSON or XML) by adding the extension to "products".
https://api.hifi-station.hu/v2/products.xml
or json
Output format
We provide two output formats: JSON and XML.
To change the output format, use the setOutputFormat
method.
Use this method before the send()
method.
Usage
Other informations
Note, that the API is not stable yet.
In the result the stock
tag is not always correct. If we have more than 10 product in stock the value always will be 10.
Functions
send()
return the response in the format you specified.
authenticate(string $username, string $password, string $api_key)
authenticate the request.
setOutputFormat(string $type)
set the output format.
public $disablePrettyHeader = false;
disable the php header()
function.
Security
Please submit bug reports, or you found a mistake in the docs, or want to add something suggestions create a pull request or go ahead and create an issue at Github issue tracker
Disclaimer
This is an open source project. We are not responsible for any damage caused by this software. If you want to update the prices of the product automatically, please note that it may differ from the price you offer.
All versions of hsapi with dependencies
ext-openssl Version *
ext-simplexml Version *
ext-json Version *