Call edge api from a "Node app" proxy type

Hi,

I would like to call edge-api from a "Node app" proxy type.

Is there any documentation or example of it, please?

I don't know how to share session or authentication.

0 4 257
4 REPLIES 4

Which/What edge-api do you want to call from Node app?

If you plan to use/call Apigee Management APIs from Node App or Proxies, it is an anti-pattern and not at all recommended.

Apigee Management APIs are not built for high availability and even does not provide near real-time data/config.

Making Edge API calls is no different than any other HTTP call within Node.js. The Edge API Documentation tells you the endpoints, the auth requirements and such so constructing Edge API HTTP calls from Node.js shouldn't take anything special just because it's running in Edge's Node.js environment.

If you could provide more information or context regarding what you're trying to do - a few more sentences, people might be able to provide more helpful advice.

Not applicable

Below is a sample node api call, you can add header authorization as well.

var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://************************.apigee.net/accounts',
  'headers': {
    'Authorization': 'Basic **********************************'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});