2017-25 © Pedro Peláez
 

library shopioapi

Shopio Rest Api Client

image

shopiolabs/shopioapi

Shopio Rest Api Client

  • Friday, March 11, 2016
  • by feridmovsumov
  • Repository
  • 2 Watchers
  • 3 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Shopio Rest Api Client

Build Status Total Downloads License, (*1)

Installation

$ composer require "shopiolabs/shopioapi":"dev-master"

Getting Started

Authentication Example

getAccessToken($_GET['code'], $scope, $_SESSION['page_url']);
    //Save access_token
} elseif (isset($_POST['shop'])) {
    // get the URL to the current page
    $pageURL = $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://';
    $pageURL = $_SERVER["SERVER_PORT"] != "80" ? $pageURL.":".$_SERVER["SERVER_PORT"] : $pageURL;
    $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER['SCRIPT_NAME'];

    $_SESSION['shop'] = $_POST['shop'];
    $_SESSION['page_url'] = $pageURL;

    $shopioAuthClient = new ShopioAuthClient($_SESSION['shop'], $apiKey, $secret);
    $authorizeUrl = $shopioAuthClient->getAuthorizeUrl($scope, $pageURL);
    header("Location: $authorizeUrl");exit;
}
?>



, (*2)

Client Usage Example

$accessToken = 'YOUR_ACCESS_TOKEN_HERE';
$shopioClient = new ShopioClient('example.myshopio.com', $accessToken);

//List brands
$brands = $shopioClient->call('brands', 'GET');

//Get a single brand
$brand = $shopioClient->call('brands/'.$brands[0]['id'], 'GET');

//Create a new brand
$data = [
    'title' => 'Test',
    'status' => '1'
];
$newBrand = $shopioClient->call('brands', 'POST', $data);

//Update a brand
$data = [
    'title' => 'test2',
];
$updatedBrand = $shopioClient->call('brands/'.$newBrand['id'], 'PUT', $data);

//Delete a brand
$shopioClient->call('brands/'.$updatedBrand['id'], 'DELETE');
````

## Tests

Run tests with the following command in root directory.

```bash
$ ./vendor/bin/phpunit

Contributing

Please see CONTRIBUTING for details., (*3)

License

The MIT License (MIT). Please see License File for more information., (*4)

The Versions

11/03 2016

dev-master

9999999-dev

Shopio Rest Api Client

  Sources   Download

MIT

The Requires

 

The Development Requires

by Farid Movsumov

shopio