To get the results of your organization whether they are security or savings, you will need to use our API.
The code below written in Node.js gets the "Security" type findings (can be changed to "Saving" if required), the only requirements are the following:
- organizationId: This parameter is required and unique.
- type: It can be "Security" or "Saving"
- secretaccesskey: You can generate it at https://app.gethypercube.com/dashboard/api
The console.log will show you the result of the request in the console, do not forget that this code requires Axios, which you can install with the following command:
npm install axios
Node.js code:
const axios = require('axios');
exports.handler = async (organizationId, type) => {
organizationId ='YOUR_ORGANIZATION_ID';
type ='Security';
const secretaccesskey = 'YOUR_SECRET_ACCESS_KEY';
const res = await axios.get('https://api.gethypercube.com/recommendations', {
headers: { secretaccesskey },
params: {
...(organizationId && { organizationId }),
...(type && { type }),
},
});
const result = res.data ? res.data : {};
console.log(JSON.stringify(result));
return JSON.stringify(result);
};
We hope this has helped you get your findings through our API.
Comments
0 comments
Please sign in to leave a comment.