Download the PHP package leadingsystems/contao-api without Composer

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

Leading Systems API bundle for Contao 4

The API bundle adds the Leading Systems API functionality to Contao 4.

This extension is meant to assist other Leading Systems extensions such as the e-commerce extension Merconis. Technically, standalone usage is possible but we can't offer support for this extension unless it's combined with Merconis.

For more information visit the Merconis website

What is LS API and what is it good for?

LS API adds REST-like API functionality to Contao and allows you to write your own API resources.

LS API can be used in the Contao frontend and backend and it comes with a basic authentication and authorization system.

Usage

Getting started

Backend usage

With this Contao extension installed the Contao backend navigation has a new navigation group "LS API". One of the navigation items is labeled "API receiver". A click on it opens the backend API endpoint in the browser window. Since no API resource has been specified, the API will present you a JSON response with information about all available resources.

The URL of the backend API endpoint will look like this:

http://mydomain.com/contao?do=be_mod_ls_apiReceiver

To call a specific API resource, the parameter "resource" needs to be added to the URL:

http://mydomain.com/contao?do=be_mod_ls_apiReceiver&resource=getCurrentBackendUserName

Calling this URL directly would result in an "access denied" response because we didn't specify an API key:

In order to use our API credentials when accessing a resource, we need to make a POST request to the API url sending the following POST parameters:

The API can accept API users, frontend users or backend users, depending on the requested resource. If a resource accepts only API users (users explicitly defined as API users in the backend) the parameters ls_api_username and ls_api_password are mandatory.

If a resource accepts frontend or backend users the parameter ls_api_key still has to be provided but the user credentials for an API user can be omitted if there's a frontend or backend user logged in.

Frontend usage

To create a frontend API endpoint you have to create a frontend module of the type LS API RECEIVER and place that frontend module on a frontend page (e.g. using a content element or placing it in the layout).

You can then call the API by simply calling this page:

http://mydomain.com/api.html

To call a specific API resource, the parameter "resource" needs to be added to the URL:

http://mydomain.com/api/resource/getCurrentFrontendUserName.html

Calling this URL directly would result in an "access denied" response because we didn't specify an API key. The frontend API endpoint behaves in exactly the same way as mentioned before with the backend API endpoint.


All versions of contao-api with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
contao/core-bundle Version ^4.13
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 leadingsystems/contao-api contains the following files

Loading the files please wait ....