title: Aws lambda + api gateway: only trigger lambda by button click
body: <p>I have an aws lambda function which runs some python code (which is calling an external api with some extra functions). I attached a trigger, an api gateway, which if I go to the url, the lambda functions runs correctly.</p>
  
  <p>However, I want the lambda function only to be run if they click on a button somewhere on the 'website' of the api-url. Rephrased otherwise, I want the api-url page to have a button, which on click executes the lambda function.
  Im think that should be quite easy, however I can't figure out how. Due to the information overload I can't seem to find the right video, document example on how to do it.</p>
  
  <ul>
  <li>Is the possible? (running the lambda function on click of a button). If so, is there some good documentation of example of this?</li>
  </ul>
  
  <p>I tried to add a button on the api-url page by, on 'method-execution' on the 'api-gateway resource' page, changing the mapping template to text/html instead of json. (a bit like in <a href="https://blog.it-playground.eu/display-html-page-using-only-api-gateway/" rel="nofollow noreferrer">https://blog.it-playground.eu/display-html-page-using-only-api-gateway/</a>) But then i can't figure out how to run the lambda function onClick of the button. ==> Is this the right start?</p>
  
  <p>(Because its not really a coding issue, I can't really provide any code).</p>
  
  <p>Also, is this question so simply that it shows I simply don't understand the basics enough (and should subsequently go over them again)?</p>