Comment interroger tiers API JSON à partir d'AWS Lambda fonction

Je suis en train de travailler sur une "Compétence" pour la nouvelle Amazon ECHO. La compétence permet à un utilisateur de demander Alexa pour plus d'informations sur l'état et les performances d'un Enphase système solaire. Alexa répond avec des résultats extraits de l'JSON en fonction Enphase API. Par exemple, l'utilisateur peut demander,

 "Alexa.  Ask Enphase how much solar energy I have produced in the last week."
 ALEXA <"Your array has produced 152kWh in the last week.">

Problème c'est que cela fait des années depuis que je l'ai programmé en JavaScript et c'est ma première fois à l'aide d'AWS Lambda. Je n'ai pas réussi à trouver toutes les informations sur la façon d'intégrer un JSON requête à un serveur tiers au sein d'AWS Lambda fonction. Voici un article pertinent du code dans ma fonction Lambda:

 /**
  * Gets power from Enphase API and prepares speach
  */
 function GetPowerFromEnphase(intent, session, callback) {
      var Power = 0;
      var repromptText = null;
      var sessionAttributes = {};
      var shouldEndSession = false;
      var speechOutput = "";

      //////////////////////////////////////////////////////////////////////
      //Need code here for sending JSON query to Enphase server to get power
      //Request:
      //https://api.enphaseenergy.com/api/v2/systems/67/summary
      //key=5e01e16f7134519e70e02c80ef61b692&user_id=4d7a45774e6a41320a
      //Response:
      //HTTP/1.1 200 OK
      //Content-Type: application/json; charset=utf-8
      //Status: 200
      //{"system_id":67,"modules":35,"size_w":6270,"current_power":271,
      //"energy_today":30030,"energy_lifetime":59847036,
      //"summary_date":"2015-03 04","source":"microinverters",
      //"status":"normal","operational_at":1201362300,
      //"last_report_at":1425517225}
      //////////////////////////////////////////////////////////////////////

      speechOutput = "Your array is producing " + Power + " kW, goodbye";
      shouldEndSession = true;

      //Setting repromptText to null signifies that we do not want to reprompt the user.
      //If the user does not respond or says something that is not understood, the session
      //will end.
      callback(sessionAttributes,
         buildSpeechletResponse(intent.name, speechOutput, repromptText,
         shouldEndSession));
 }

Quelques conseils seraient appréciés. Même si quelqu'un pouvait me diriger dans la bonne direction. Merci!

OriginalL'auteur Darko | 2015-12-01