Download the PHP package flux-se/odoo-api-client without Composer

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

Latest Version on Packagist Build Status Quality Score

Odoo API client

Odoo (formerly OpenERP) is a Belgian suite of business management software tools (PGI) : https://www.odoo.com/.

This library allow communication trough Odoo JSON-RPC or XML-RPC API. Documentation about it can be found here (for the XML-RPC one, none for the JSON-RPC) : https://www.odoo.com/documentation/master/developer/reference/external_api.html

This library will allow you to :

Installation

Composer

Install using Composer :

php-http/guzzle7-adapter and http-interop/http-factory-guzzle are 2 requirements which can be chosen among php-http/client-implementation and psr/http-factory-implementation

Object models generation

First gather required credential and database info described here.

Depending on your Odoo instance the object models available will be different, that's why this library is allowing you to generate model classes using this cli command :

This command is using env vars to guess the credentials and database info, you can use those env vars to set your credential globally :

  • ODOO_API_HOST
  • ODOO_API_DATABASE
  • ODOO_API_USERNAME
  • ODOO_API_PASSWORD

Introduction

This chapter will describe how the two Odoo APIs are working.

JSON-RPC (Click me to see detailed info) ### JSON-RPC The Odoo JSON-RPC API expose 1 main endpoint `/jsonrpc`. The body request payload is a JSON object with specific data into it : The service param can be set with those 3 values : - `db` allowing to manage the postgres database - `common` allowing to authenticate a user or get info about the Odoo installation - `object` allowing operations with all API exposed models This library help you to use those endpoints using `ext-json` and `HttPlug`, **it also allows you to consume Odoo API using PHP classes representation of all installed Odoo Models**.
XML-RPC (Click me to see detailed info) ### XML-RPC The Odoo XML-RPC API expose 3 main endpoints : - `/xmlrpc/2/db` allowing to manage the postgres database - `/xmlrpc/2/common` allowing to authenticate a user or get info about the Odoo installation - `/xmlrpc/2/object` allowing operations with all API exposed models This library help you to use those endpoints using `ext-xmlrpc` and `HttPlug`, **it also allows you to consume Odoo API using PHP classes representation of all installed Odoo Models**. The authentication is not standard (compare to other APIs), your username and your password will be used during a call to `/xmlrpc/2/common` with the XML-RPC method `authenticate` (or `login`) returning your Odoo user id (`uid`). This uid, your password and your Odoo database name are required to make every request calls to the `/xmlrpc/2/object` endpoint.

Usage example

Using this library you will be able to use two ways of consuming the Odoo XML-RPC API :

  1. using array
  2. using object model classes

Using Array

List your first partner (Contact) :

By default, the JSON-RPC API will be used, if you want to use XML-RPC create an Odoo Api Client builder like this :

Using object model

First you can generate classes based on the Odoo instance you have, for example:

💡 Here we are generating only one class, but you can also generate all classes excluding some of them (see info here).

Know issues

Development

Using docker

The server is fully ready to use when this log line appears (Odoo v13 could take longer than upper version to reach this line) :

Generate the model classes based on the docker Odoo instance :

This script will use env vars to gather info about the Odoo instance you are targeting (see info here).

Test the code against the generated classes from your own Odoo instance

`


All versions of odoo-api-client with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
php-http/client-implementation Version ^1.0
php-http/client-common Version ^2.1
php-http/discovery Version ^1.7
psr/http-factory-implementation Version ^1.0
symfony/console Version ^6.4|^7.1
symfony/serializer Version ^6.4|^7.1
symfony/property-access Version ^6.4|^7.1
symfony/property-info Version ^6.4|^7.1
symfony/string Version ^6.4|^7.1
symfony/http-kernel Version ^6.4|^7.1
php-http/logger-plugin Version ^1.1
phpdocumentor/reflection-docblock Version ^5.4
prometee/php-class-generator Version ^1.0
webmozart/assert Version ^1
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 flux-se/odoo-api-client contains the following files

Loading the files please wait ....