Typescript library for interacting with Dolibarr REST API
Install the package in your project
npm install dolibarr-api-ts
Create an instance of the main class indicating the url of your Dolibarr installation
import { DolibarrAPI } from 'dolibarr-api-ts';
const api = new Dolibarr('https://your-doibarr-url.com');
const username = 'exampleuser';
const password = 'examplepassword';
api.login(username, password).then(
(response) => {
if(response)
console.log('Login correcto');
else
console.log('Login incorrecto');
},
(error) => {
console.log('Error: ', error);
}
);
- BankAccounts
- Contacts
- Documents
- Invoices
- Proposals
- ThirdParties
- Users
Create a resource instance and get all the items (invoices)
import { DolibarrAPI, Invoices } from 'dolibarr-api-ts';
/* ...Create API class instance and login...*/
const invoices = new Invoices(api);
invoices.find().then(
(data) => {
console.log(JSON.stringify(data));
},
(error) => {
console.log('Error: ', error);
}
);
Explore in the code of this library the different classes of resources to consult the documentation of the use of each method and take a look at the documentation of the Dolibarr REST API module
https://wiki.dolibarr.org/index.php?title=Module_Web_Services_API_REST_(developer)
- Fork
develop
branch - Push changes to your fork.
- Submit a pull request.
https://github.com/i22almoj/dolibarr-api-ts
GPLv3