Client to consume BAPP API, auto-generated using openapi-typescript-codegen.
import { bappAxiosClient, OpenAPI, CoreService, CompanyService } from '@bapp/api-client';
// Authentication
OpenAPI.TOKEN = "<YOUR_TOKEN>";
// OR
OpenAPI.TOKEN = async () => {
// Custom logic to get API TOKEN, return empty string if token not available
};
// Usage
CoreService.coreCorList({}); // Get first page of COR codes
CoreService.coreCorList({ page: 2 }); // Get 2nd page of COR codes
CompanyService.companyBankAccountsList({ xCompanyId: 1, }); // Get first page of company bank accounts
CompanyService.companyBankAccountsRetrieve({ xCompanyId: 1, id: 1 }); // Get company bank account with id 1
// Use the axios instance that the api client uses to make requests
bappAxiosClient.interceptors.response.use(undefined, (error) => {
console.error(error);
});