2017 © Pedro Peláez
 

library kodix-api-sdk

Sdk package for working with kodix.api

image

sqmmm/kodix-api-sdk

Sdk package for working with kodix.api

  • Thursday, June 28, 2018
  • by SQMmm
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 20 % Grown

The README.md

kodix-api-sdk

Kodix-api-sdk php client for working with kodix services api., (*1)

Available scopes, entities and methods

  • DealerStorage - contains all data about dealer centeres. All entities have tha same methods (getList, get, add, update, delete):
    • dealerships
    • holdings
    • brands
  • PartsStorage - contains all data about dealer`s service parts. Entities:
    • parts
    • dealers

Authorization

use Kodix\Api\Client;

$apiClient = new Client();

// set login and pass for authorization (if token has expired)
$apiClient->setAccessLogin($params['login']);
$apiClient->setAccessPassword($params['password']);

//this callback function is used if token has expired
$apiClient->setOnTokenExpiredFunction(function(Client $client) {
    $token = $client->auth();
    if($token){
        //you can save new token

        return true;
    }
    return false;
});

if(isset($params['token'])) {
    $apiClient->setAccessToken($params['token']);

}else{
    $token = $apiClient->auth();

    if($token){
        // save new token
    }
}

Getting/updating data

// Getting the list of dealerships with brand filtering by ids.
$dealerships = new Dealership($apiClient);
$response = $dealerships->getList(['filter' => ['id' => $ids], 'with' => ['brand']]);
$statusCode = $response->getCode();
$errors = $response->getErrors();

if(is_array($errors) && count($errors) > 0 ){
    $items = [];
}else {
    $data = $response->getData();
    $items = $data['items'];
}

Docs

The Versions

28/06 2018

dev-master

9999999-dev https://github.com/sqmmm/kodix-api-sdk

Sdk package for working with kodix.api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mariya Ivanova

api sdk sqmmm kodix-api-sdk kodix

28/06 2018

dev-dev

dev-dev https://github.com/sqmmm/kodix-api-sdk

Sdk package for working with kodix.api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mariya Ivanova

api sdk sqmmm kodix-api-sdk kodix

23/05 2018

0.0.4

0.0.4.0 https://github.com/sqmmm/kodix-api-sdk

Sdk package for working with kodix.api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mariya Ivanova

api sdk sqmmm kodix-api-sdk kodix

21/05 2018

0.0.3

0.0.3.0 https://github.com/sqmmm/kodix-api-sdk

Sdk package for working with kodix.api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mariya Ivanova

api sdk sqmmm kodix-api-sdk kodix

18/05 2018

0.0.2

0.0.2.0 https://github.com/sqmmm/kodix-api-sdk

Sdk package for working with kodix.api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mariya Ivanova

api sdk sqmmm kodix-api-sdk kodix

17/05 2018

0.0.1

0.0.1.0 https://github.com/sqmmm/kodix-api-sdk

Sdk package for working with kodix.api

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mariya Ivanova

api sdk sqmmm kodix-api-sdk kodix