---
title: 'CPI Password API for Payslip Security'
---
CPI Password API for Payslip Security
===
## Table of Contents
[TOC]
## Pre Requisites
Make Sure you have installed these before proceeding.
1. [node.js]
2. PHP/ NBS instance
Setup
---
> Make sure you placed the `/API` directory inside NBS instance of the client.
> The `API_Request_Password` can be in the desktop or anywhere accessible by the user.
### API Setup
* Go to `/API` folder and run `npm i`.
* After installing of required files of the NPM, please install this as a service by running `node install_service.js`
* Modify database credentials inside `\API\config\env.js`
```sql=
const env = {
database: {
name: 'northeast',
port:3308,
username: 'root',
password: '',
host: 'localhost',
dialect: 'mysql',
charset: 'utf8mb4',
pool: {
max: 5,
min: 0,
acquire: 30000,
idle: 10000
},
},
port: 3000
};
module.exports = env;
```
### PHP CURL Setup
* Edit batch file inside the `API_Request_Password` directory, set PHP.exe location and also the php file location of the API caller.
Using the API and the Batch file
---
Just run the batch file and provide username and password according to ERP login credentials. The API will produce .CSV file of the Passwords.
[node.js]: <https://nodejs.org/dist/v10.16.0/node-v10.16.0-x64.msi>