2017 © Pedro Peláez
 

library api-library-php5

PHP interface for OneSky Platform API

image

onesky/api-library-php5

PHP interface for OneSky Platform API

  • Sunday, January 7, 2018
  • by vlmh
  • Repository
  • 14 Watchers
  • 13 Stars
  • 150,768 Installations
  • PHP
  • 7 Dependents
  • 0 Suggesters
  • 13 Forks
  • 9 Open issues
  • 6 Versions
  • 9 % Grown

The README.md

Build Status Code Coverage, (*1)

Onesky PHP5 API Library

PHP5 library for OneSky API, (*2)

Requirements

  • PHP 5.1 or higher
  • CURL extension

Installation

Install the latest version with composer require onesky/api-library-php5, (*3)

How to use

Create instance, (*4)

use Onesky\Api\Client;

$client = new Client();

Set API key and secret, (*5)

$client->setApiKey('<api-key>')->setSecret('<api-secret>');

Way to make request, (*6)

// resource   => name of resource in camelcase with 's' tailing such as 'projectTypes', 'quotations', 'importTasks'
// action     => action to take such as 'list', 'show', 'upload', 'export'
// parameters => parameters passed in the request including URL param such as 'project_id', 'files', 'locale'
$client->{resource}('{action}', array({parameters}));

Sample request and get response in array, (*7)

// list project groups
$response = $client->projectTypes('list');
$response = json_decode($response, true);

// show a project
$response = $client->projects('show', array('project_id' => 999));
$response = json_decode($response, true);

// upload file
$response = $client->files('upload', array(
    'project_id'  => 999,
    'file'        => 'path/to/string.yml',
    'file_format' => 'YAML',
    'locale'      => 'fr'
));
$response = json_decode($response, true);

// export translation
$response = $client->translations('export', array(
    'project_id' => 999,
    'locale'     => 'ja',
    'source_file_name' => 'string.yml'
));
file_put_contents('path/to/file', $response);

// create order
$response = $client->orders('create', array(
    'project_id' => 999,
    'files'      => 'string.yml',
    'to_locale'  => 'de'
));
$response = json_decode($response, true);

How to contribute

Or pick one of the issues and create a PR to solve it., (*8)

How to run tests

Note: need to install dependencies using composer to have phpunit., (*9)

vendor/bin/phpunit

The Versions

07/01 2018

dev-master

9999999-dev https://github.com/onesky/api-library-php5

PHP interface for OneSky Platform API

  Sources   Download

MIT

The Requires

  • php >=5.1.0
  • ext-curl *

 

The Development Requires

09/06 2015

v1.0.5

1.0.5.0 https://github.com/onesky/api-library-php5

PHP interface for OneSky Platform API

  Sources   Download

MIT

The Requires

  • php >=5.1.0
  • ext-curl *

 

The Development Requires

30/12 2014

1.0.3

1.0.3.0 https://github.com/onesky/api-library-php5

PHP interface for OneSky Platform API

  Sources   Download

MIT

The Development Requires

30/12 2014

1.0.2

1.0.2.0 https://github.com/onesky/api-library-php5

PHP interface for OneSky Platform API

  Sources   Download

MIT

The Development Requires

11/12 2014

v1.0.1

1.0.1.0 https://github.com/onesky/api-library-php5

PHP interface for OneSky Platform API

  Sources   Download

MIT

The Development Requires

11/12 2014