Download the PHP package mcrock/allegroapi without Composer

On this page you can find all versions of the php package mcrock/allegroapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package allegroapi

allegroapi PHP SDK

Library that makes allegro rest and soap api using easier

Installation

This lib should be installed with composer

Requirements

REST Api usage

Usage of allegro rest api is very simple with this library.

Prepare credentials

First, you should create object Credentials, or implement CredentialsInterface in your own class.

Get your token

Every operation in REST Api needs OAuth token. You can easily get it with this library.

After logging in Allegro.pl you will be redirected to your RedirectUrl with auth code in query string. What next?

You can store Token serializing it, or storing it's values. You can also implement TokenInterface to create a solution that suits your needs.

If your token has expired, just generate new one with this method:

Usage of API methods

The best explanation how to use it will be some example, so here it is:

With that simple way you can use all api methods. Alternative method is use prepared request classes.

Ready-to-use request classes location: here I already covered almost all rest api methods. I'll try to create all to cover 100%.

Of course you can create your own, just implement RequestInterface. It's very simple.

Example:

Exceptions

I've created two Exception classes: InvalidRequestMethodException - just means that you used wrong HTTP method name in your request. UnauthorizedClientException - you should catch it just to know when refreshing token is necessary.

SOAP API

There is a class AllegroApiSoapClient inside this lib, and you can use it, by so far I got no time to finish it. It should work ok, but I need some time to document it.

Sandbox

Allegro Api Sandbox is problematic. It almost never works properly, so if you want to test your app, just use production API. Trust me, there is no good reason to implement Sandbox endpoints :)

Few ending words

If you have any suggestions, or noticed any issues, feel free to report it, or contact me.


All versions of allegroapi with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.0
guzzlehttp/guzzle Version ^6.3
ramsey/uuid Version ^3.7
lcobucci/jwt Version ^3.2
wsdl2phpgenerator/wsdl2phpgenerator Version ^3.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mcrock/allegroapi contains the following files

Loading the files please wait ....