This is a solution for Aircall
- Clone the app from github
- Install the dependendcies using "npm install"
- Create a file named "access_token" in the directory of /src
-
Paste this code to the file => const access_token: string = 'Your access key';
export default access_token; - Run the authentication code written down below (Run it using node)
- You will get access token, paste the access token to access_token variable inside 'Your access key' (step 4)
- Run 'npm start' in terminal
- The app now runs!
// Install axios using => npm install axios const axios = require('axios').default; axios.post("https://frontend-test-api.aircall.io/auth/login", { username: "userName", password: "password" }) .then((res) => console.log(res.data)) .catch((err) => console.log(err))
Run this code in any javascript file you want my recommendation is create a file then run it using node
Note that access token is valid only 10 minutes so you need to run this code and get access token every 10 minutes