infojobs-api-library
v1.1.0
Published
InfoJobs API Client Library for Node.js
Downloads
1
Maintainers
Readme
InfoJobs API Library: Node.js Client
This is InfoJobs's unofficially supported node.js client API library.
Features
- 📦 Tree-shakeable
- ⚡ Fast
- ✨ Lightweight
- ❤️ Strongly typed
Installation
npm install infojobs-api-library
How to use
// ES6 imports supported
// import infojobs from 'infojobs-api-library';
const infojobs = require('infojobs-api-library');
const apiClient = infojobs.api({
clientId: process.env.CLIENT_ID,
clientSecret: process.env.CLIENT_SECRET,
});
const offerList = await apiClient.offer.list({
q: ['React Developer', 'Médico'],
province: ['Madrid', 'Barcelona'],
});
console.log(offerList);
const offer = await apiClient.offer.get({
offerId: '65b4adb85b4ac68363a309cde31228',
});
console.log(offer);
Make private API requests.
const auth = new infojobs.auth({
clientId: process.env.CLIENT_ID,
clientSecret: process.env.CLIENT_SECRET,
redirectUri: process.env.REDIRECT_URI,
});
// The verification code will be generated by InfoJobs and sent to your application as a parameter of the Callback URI you specified when registering your application.
const dialogUrl = auth.generateAuthUrl({
scope: 'CV',
responseType: 'code',
});
console.log(dialogUrl);
// IMPORTANT
// You need the verification code generated with the dialog url
const token = await auth.getAccessToken(code);
const res = await apiClient.curriculum.get({ token: token.access_token });
console.log(res);
const education = await apiClient.curriculum.details.education({
token: token.access_token,
curriculumId: '7a73bfbd-c3fe-426e-a99e-3454d9fd2dd4',
details: true,
});
console.log(education);
Supported API methods:
Job Search
| Name | Type | Description | | ---- | ---------------- | ------------------------------------------------------------------ | | GET | /offer | Returns a list of Job Offers that comply with the search criteria. | | GET | /offer/{offerId} | Returns the detail of the offer with the given id. |
CV Visualization and Edition
| Name | Type | Description | | ---- | ---------------------------------------------------- | ---------------------------------------------------------------------- | | GET | /curriculum | Returns list of CVs of the authenticated user. | | GET | /curriculum/{curriculumId}/cvtext | Gets the curriculum in text format | | GET | /curriculum/{curriculumId}/education | Gets the education details of the curriculum | | GET | /curriculum/{curriculumId}/education/{educationId} | Retrieves education details for a given CV for the authenticated user. | | GET | /curriculum/{curriculumId}/experience/{experienceId} | Retrieves the experience requested. | | GET | /curriculum/{curriculumId}/experience | Retrieve the experiences from the given curriculum Id. | | GET | /curriculum/{curriculumId}/futurejob | Gets the future job fields of the curriculum | | GET | /curriculum/{curriculumId}/personaldata | Gets the personal data of the curriculum's owner | | GET | /curriculum/{curriculumId}/skill | Gets the curriculum skills |
Feel free to collaborate.
Contributing
Are you interested in contributing to the project? Thank you very much for your interest. We are always looking for improvements to the project and contributions from open source developers are greatly appreciated. If you have a contribution in mind, please see our Contribution Guide for information on how to do so.