Module Web Services API REST (developer): Difference between revisions

Jump to navigation Jump to search
m
Line 50: Line 50:
= Installation =
= Installation =


To install, open the modules page and activate de API REST module. On the configuration page of the module, There's two links. No need to click on the first, it doesnt work as is.
To install, open the modules page and activate de API REST module. On the configuration page of the module, there's a link to an explorer. Click on it to open the API explorer.


The link has this pattern = <nowiki>http://<my server>/api/index.php/login?login=<user login>&password=yourpassword</nowiki><br/>
On the top right corner, paste the <token> of the user you want to use to call the API and click the "explore" button. Note: The token of each user can be defined on the user record page.  
copy the link and replace yourpassword by your user password. <my server> and <user login> should have been already replaced. Past the link in your browser to generate your <token>. This token is linked to the user account.<br/>


Write down this <token> as you will need it later !!!
After clicking on "Explore", you should see all the actions available with this token. If you don't have a lot of actions, it's probably because the according modules are not activated. If you want to see the invoices, you have to activate the invoice module in the configuration of Dolibarr. Same for products, third parties and so on.


Now, You can use the second link on the configuration page of the module. On the top right corner, paste your <token> and click the "explore" button. You should see all the actions available with this token. If you don't have a lot of actions, it's probably because the according modules are not activated. If you want to see the invoices, you have to activate the invoice module in the configuration of Dolibarr. Same for products, thirdparties and so on.<br/>
On this exploration page of the API, you can do quite a lot of tests. Reading datas from Dolibarr and writing, modifying and deleting as well.
On this exploration page of the API, you can do quite a lot of tests. Reading datas from Dolibarr and writing, modifying and deleting as well.


Navigation menu