Difference between revisions of "Module Web Services API REST (developer)"

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search
m
Line 39: Line 39:
 
= Adding a new service =
 
= Adding a new service =
 
Adding a new REST service is as easy than adding a file called '''api_mymoduleobject.class.php''' into the directory '''htdocs/module/class'''.
 
Adding a new REST service is as easy than adding a file called '''api_mymoduleobject.class.php''' into the directory '''htdocs/module/class'''.
 +
You take the example into '''htdocs/commande/class/api_orders.class.php'''

Revision as of 17:31, 9 September 2016

Web services
Numero/ID of module 2610
User doc. of module Not applicable
Developer doc. of module This page





Function

When enabling this module, you enable usage of web services provided by Dolibarr server. You can then make REST call of different web services provided by Dolibarr.

Dolibarr REST web services server

Once module webservices REST is activated, Dolibarr become also a server of REST web services. So you can send your own REST request to relative URL /api/index.php

List of provided services

Only few services are available. Starting to Dolibarr 5.0 version, you can see full list of Dolibarr Webservices provided, by calling the explorer here at address:

http://yourdolibarrurl/api/index.php/explorer.

You must first make the first call to the login api to get the api key. Then enter api key to get list of all other available services.

For example, you can try the explorer on the demo instance at:

https://demo.dolibarr.org/api/index.php/explorer

You must first make the first call to the login api to get the api key. Then enter api key to get list of all other available services.

Adding a new service

Adding a new REST service is as easy than adding a file called api_mymoduleobject.class.php into the directory htdocs/module/class. You take the example into htdocs/commande/class/api_orders.class.php