AWS Lambda and Gateway API Integration, returns status code 500
<p>First of all, I am new to whole AWS itself. I am trying to solve a problem using AWS lambda and API Gateway.</p>

<ol>
<li>I created a python lambda function. It takes some data and returns a <code>string</code> based on some conditions. Something like below:</li>
</ol>

<blockquote>
<pre><code>def lambda_function(event, context):
    if event['some_property']:
        return "SUCCESS: Operation performed successfully."
    else
        return "ERROR: Operation failed."
</code></pre>
</blockquote>

<ol start="2">
<li><p>Under the triggers , I set up a gateway API.</p></li>
<li><p>In API gateway service for the created resource, the integration request is configured to pass through to the lambda function. I have tested lambda function and it returns values properly.</p></li>
<li><p>But if i curl the API making a post request, it returns a server error. The message is this. </p></li>
</ol>

<blockquote>
  <p>{"message": "internal server error"}</p>
</blockquote>

<ol start="5">
<li>I tried to play around. If i return an empty json from function and create a body mapping template with Content Type as <code>application/json</code> and use empty model template for it, then it works fine.</li>
</ol>

<p>I guess , I am missing something in Integration Response part. What i want is to return a <code>200</code> status code along with the success message, if the operation is performed successfully.</p>