Hi,
As the title states, I would like to make a request to an external API (that I don't own) on the server side of my plugin. The API I'm querying requires that I pass the key, certificate, and CA to it however, and whenever I do, my plugin gets disabled for some reason.
I don't know if this is a good way of doing this external call, and I haven't been able to get the call to work on the front-end as described in How to call external web service from Kibana Plugin? as well as How to call external web service from Kibana Plugin?
I need to get a large amount of data from this API and hopefully, eventually, put it into elasticsearch, all through this plugin if possible. For now I'd be happy with just a successful call, back-end or front. (working on Kibana 6.2.4)
Here's an example:
import request from 'request';
import fs from 'fs';
var options = {
uri: 'external-api-path.com:port',
method: "POST"
key: fs.readFileSync('path/to/key.pem'),
cert: fs.readFileSync('path/to/cert.pem'),
ca: fs.readFileSync('path/to/ca.pem')
}
request(options, function callback(err, response, body) {
if (err) {
reply(err);
}
reply(body);
});