Download the PHP package aftermarketpl/api without Composer

On this page you can find all versions of the php package aftermarketpl/api. 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 api

AfterMarket.pl API client class for PHP

This library allows you to issue calls to the AfterMarket.pl public API from PHP.

Quick start

Install the library using composer.

Create the API client object, providing your API key. Click here to obtain your API key.

Call an API function and obtain a result. Click here to see the list of API functions.

Use Guzzle-style asynchronous call:

Installation

You can install the API library in two ways.

  1. The easiest way is to use composer:

  2. If you are not using composer, you can install the library manually. In order to do that, download and unpack the files (only the lib directory is necessary), and include the library's autoloader in your PHP files:

In the latter case, you don't need the Guzzle library if you don't plan on using asynchronous requests

API keys

To connect to the API, you need an API key. Click here to obtain your API key.

You can have more than one API key. Each API key has a set of operations which can be performed using that key. You can also limit the key usage to a specific set of IP addresses.

After creating an API key, you can modify its permissions, revoke or disable it on the Aftermarket.pl website.

Reference

Creating the class

To create a new client class, use:

The $options variable is an array, which can contain the following values:

The parameters key and secret are necessary for making calls to the API. However, you do not need to specify them at class creation time - see the section Modifying the class below.

Making API calls

The function send() is used to send an API command to the server. You need to specify two parameters:

The return value is the data structure returned by the API command. Its contents also depend on the actual command used - see the API reference for details on what is being returned by each command.

Asynchronous calls

The function sendAsync() uses the Guzzle library to send an API call asynchronously. The input parameters are the same as with the send() function, but the returned value is a promise which resolves to the data structure returned from the API command.

Refer to Guzzle documentation for information on how to use promises with asynchronous calls.

Exceptions

If something goes wrong, a subclass of Aftermarketpl\Api\Exception\Exception is thrown. This class extends the standard Exception class with the method getResponse(), which returns the contents of the response received from the server. This value is, of course, only valid when the actual call to the server has been made; if the error occurred before that, the value is null.

Modifying the class

You can modify the created client class in runtime, using the following functions:


All versions of api with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
guzzlehttp/guzzle Version *
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 aftermarketpl/api contains the following files

Loading the files please wait ....