-
Notifications
You must be signed in to change notification settings - Fork 0
/
ResumeParsing.js
34 lines (26 loc) · 922 Bytes
/
ResumeParsing.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//promised-based HTTP client allow to call eden AI API
const axios = require('axios').default;
//initialise file system to access file on computer
const fs = require("fs");
//create multipart form data parameters form
const FormData = require("form-data");
const form = new FormData();
//add form data parameters to the request
form.append("providers","affinda,hireability")
form.append("file", fs.createReadStream("./Resume-Titouhi-Omar.pdf"));
//configure the request
const options = {
method: 'POST',
url: 'https://api.edenai.run/v2/ocr/resume_parser',
headers:{
authorization: 'Bearer API_KEY',
'Content-Type': `multipart/form-data; boundary=${form.getBoundary()}`
},
data: form
};
//launch the request and print the result
axios.request(options).then((response) =>{
console.log(response.data);
const data = JSON.stringify(response.data);
console.log(data);
});