2017 © Pedro Peláez
 

library allegro-rest-api

simple interface for Allegro REST API

image

wiatrogon/allegro-rest-api

simple interface for Allegro REST API

  • Tuesday, May 15, 2018
  • by wiatrogon
  • Repository
  • 5 Watchers
  • 7 Stars
  • 110 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 2 Open issues
  • 9 Versions
  • 24 % Grown

The README.md

php-allegro-rest-api

Simple interface for Allegro REST API resources, (*1)

Authorization and Tokens

In order to use Allegro REST Api, you have to register your application and authorize it (https://developer.allegroapi.io/auth/)., (*2)

$api = new Api($clientId, $clientSecret, $apiKey, $redirectUri, null, null);
echo $api->getAuthorizationUri();

Getting new token

# example contents of your_redirect_uri.com/index.php
$code = $_GET['code'];
$api = new Api($clientId, $clientSecret, $apiKey, $redirectUri, null, null);
$response = $api->getNewAccessToken($code);
# response contains json with your access_token and refresh_token

Refreshing existing token

$api = new Api($clientId, $clientSecret, $apiKey, $redirectUri, $accessToken, $refreshToken);
$response = $api->refreshAccessToken();
# response contains json with your new access_token and refresh_token

Example usage

$api = new Api($clientId, $clientSecret, $apiKey, $redirectUri, $accessToken, $refreshToken);

// GET https://allegroapi.io/{resource}
// $api->{resource}->get();

// GET https://allegroapi.io/categories
$api->categories->get();

// GET https://allegroapi.io/{resource}/{resource_id}
// $api->{resource}({resource_id})->get();

// GET https://allegroapi.io/categories/2
$api->categories(2)->get();

// PUT https://allegroapi.io/{resource}/{resource_id}/{command-name}-command/{uuid}
// $api->{resource}({resource_id})->commands()->{command_name}($data);

// PUT https://allegroapi.io/offers/12345/change-price-commands/84c16171-233a-42de-8115-1f1235c8bc0f
$api->offers(12345)->commands()->change_price($data);

The Versions

15/05 2018

dev-master

9999999-dev

simple interface for Allegro REST API

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

by Piotr Jakubik

rest allegro

15/05 2018

0.0.7

0.0.7.0

simple interface for Allegro REST API

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

by Piotr Jakubik

rest allegro

13/03 2018

0.0.6

0.0.6.0

simple interface for Allegro REST API

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

by Piotr Jakubik

rest allegro

20/11 2017

0.0.5

0.0.5.0

simple interface for Allegro REST API

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

by Piotr Jakubik

rest allegro

24/01 2017

0.0.4

0.0.4.0

simple interface for Allegro REST API

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

by Piotr Jakubik

rest allegro

12/12 2016

0.0.3

0.0.3.0

simple interface for Allegro REST API

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

by Piotr Jakubik

rest allegro

10/11 2016

0.0.1b

0.0.1.0-beta

simple interface for Allegro REST API

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Piotr Jakubik

rest allegro

10/11 2016

0.0.2

0.0.2.0

simple interface for Allegro REST API

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Piotr Jakubik

rest allegro

10/11 2016

0.0.1

0.0.1.0

simple interface for Allegro REST API

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Piotr Jakubik

rest allegro