title: How to call an external API or URL ( python code) in AWS lambda function?
body: <p>The code that I included to call a API in AWS lambda is given below. urlilb3 python library is uploaded as a zip folder successfully. But when I try to access the particular intent it shows</p>
  
  <p>When I included the API call in AWS lambda (python 3.6), I got </p>
  
  <blockquote>
    <p>"The remote endpoint could not be called, or the response it returned was invalid" . </p>
  </blockquote>
  
  <p>Why is it so? What are the prerequisites to be done before including the API calls in python 3.6. I used urllib3 python library and upload as zip folder.?? Is any other things required to do??</p>
  
  <pre><code>def get_weather(session):
      should_end_session = False
      speech_output = " "
      reprompt_text = ""
      api = "some url ...."
      http = urllib3.PoolManager()
      response = http.request('GET',api)
      weather_status = json.loads(response.data.decode('utf-8'))
      for weather in weather_status:
          final_weather = weather["WeatherText"]
      return build_response(session_attributes, build_speechlet_response(speech_output, reprompt_text, should_end_session)) 
  </code></pre>