31,003
edits
Tag: 2017 source edit |
Tag: 2017 source edit |
||
| Line 451: | Line 451: | ||
=Develop your own service / API= | =Develop your own service / API= | ||
Adding a new REST service is as easy than adding a file called '''api_mymoduleobject.class.php''' into the directory '''htdocs/mymodule/class'''. | Adding a new REST service is as easy than adding a file called '''api_mymoduleobject.class.php''' into the directory '''htdocs/mymodule/class'''. | ||
You take | You can take an example into '''htdocs/commande/class/api_orders.class.php''' | ||
Note that if you use the '''modulebuilder''' tool, | Note that if you use the '''modulebuilder''' tool, this file may be generated for you. | ||
The framework detects automatically the API and it should be visible into the explorer. | The framework detects automatically the API files and it should be visible into the explorer. | ||
Method and parameters are detected according to introspection done into PHP class of the object ('''htdocs/mymodule/class/object.class.php''') using the '''annotations''' found into the class. | Method and parameters are detected according to introspection done into PHP class of the object ('''htdocs/mymodule/class/object.class.php''') using the '''annotations''' found into the class. | ||
| Line 462: | Line 462: | ||
These are just the basics. | These are just the basics. | ||
To find all existing API files in Dolibarr, you can search all files htdocs/<directory>/class/api_xxx_class.php | |||