Here is the code snippet:
// Article Summary
var params = {
host: 'api.smmry.com',
path: '/',
body: {
SM_API_KEY: 'B...',
SM_URL: 'www.bbc.com/sampleNews'
}
};
http.get(params, function(res) {
res.on('data', function(data) {
console.log(JSON.parse(data.toString()));
});
});
I have been attempting to make a functional API request without success. I attempted to structure the data like this:
var params = {
host: 'api.smmry.com',
path: '/',
SM_API_KEY: 'B...',
SM_URL: 'www.bbc.com/sampleNews'
};
Also tried:
var params = {
host: 'api.smmry.com',
path: '/',
data: {
SM_API_KEY: 'B...',
SM_URL: 'www.bbc.com/sampleNews'
}
};
The encountered error:
{ sm_api_error: 1, sm_api_message: 'INSUFFICIENT VARIABLES' }