2017 © Pedro Peláez
 

library hiboutikapi

Hiboutik API REST client

image

hiboutik/hiboutikapi

Hiboutik API REST client

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 6 Versions
  • 28 % Grown

The README.md

PHP library for Hiboutik API

This repository contains the open source PHP library that allows you to access the Hiboutik Platform from your PHP app., (*1)

Requirements

  • PHP 5.3.0 or newer
  • PHP cURL extension

Installation

Composer

The Hiboutik PHP library can be installed with Composer. Run this command:, (*2)

composer require hiboutik/hiboutikapi

And in your script, (*3)

<?php
require 'vendor/autoload.php';

Manual installation

Download this package and include the autoloader., (*4)

<?php

require 'HiboutikAPI/src/Hiboutik/autoloader.php';

Quick Documentation

There are two types of authentication available: basic and OAuth., (*5)

Basic authentication

$hiboutik = new \Hiboutik\HiboutikAPI(YOUR_HIBOUTIK_ACCOUNT, USER, KEY);

OAuth

$hiboutik = new \Hiboutik\HiboutikAPI(YOUR_HIBOUTIK_ACCOUNT);
$hiboutik->oauth(ACCESS_TOKEN);

Usage

To list all active products on your account:, (*6)

$result = $hiboutik->get("/products/");
if ($hiboutik->request_ok) {
  print_r($result);
} else {
  if (isset($result['details']['error_description'])) {
    print $result['details']['error_description'];
  } else {
    print $result['error_description'];
  }
}

To create a new product:, (*7)

$result = $hiboutik->post("products", [
  "product_model" => "My product",
  "product_barcode" => "",
  "product_brand" => "2",
  "product_supplier" => "2",
  "product_price" => "99.90",
  "product_discount_price" => "89.90",
  "product_category" => 5,
  "product_size_type" => 0,
  "product_stock_management" => 0,
  "product_supplier_reference" => "",
  "product_vat" => 0
]);

if ($hiboutik->request_ok) {
  print 'Product created!';
} else {
  if (isset($result['details']['error_description'])) {
    print $result['details']['error_description'];
  } else {
    print $result['error_description'];
  }
}

Pagination

The large datasets are paginated in the Hiboutik's API. Get the pagination information:, (*8)

$pagination = $hiboutik->pagination();

Legacy support

For the scripts using the previous version of this package the old methods are still available. The only difference is in the addition of a parameter in the constructor. The API version must be specified for the v1:, (*9)

$hiboutik = new \Hiboutik\HiboutikAPI(YOUR_HIBOUTIK_ACCOUNT, USER, KEY, '1');

The Versions

17/07 2018

dev-master

9999999-dev https://www.hiboutik.com/

Hiboutik API REST client

  Sources   Download

GPLv3 GPL-3.0 GPL-3.0-or-later

The Requires

  • php >=5.3
  • ext-curl *

 

api hiboutik hiboutikapi

26/01 2018

v1.1.1

1.1.1.0 http://www.hiboutik.com/

Hiboutik API REST

  Sources   Download

GPL-3.0-or-later

The Requires

 

hiboutik

20/10 2017

1.1.0

1.1.0.0 http://www.hiboutik.com/

Hiboutik API REST

  Sources   Download

GPLv3

The Requires

 

hiboutik

20/10 2017

dev-dev

dev-dev http://www.hiboutik.com/

Hiboutik API REST

  Sources   Download

GPLv3

The Requires

 

hiboutik

15/12 2015

1.0.1

1.0.1.0 http://www.hiboutik.com/

Hiboutik API REST

  Sources   Download

GPLv3

The Requires

 

hiboutik

14/12 2015

1.0.0

1.0.0.0 http://www.hiboutik.com/

Hiboutik API REST

  Sources   Download

GPLv3

The Requires

 

hiboutik