# Serverless api gateway function error

**URL:** <https://forum.serverless.com/t/serverless-api-gateway-function-error/484>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [October 10, 2016, 9:41am UTC](https://forum.serverless.com/t/serverless-api-gateway-function-error/484 "2016-10-10T09:41:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![frengkys](https://avatars.discourse-cdn.com/v4/letter/f/9fc348/32.png) [@frengkys](https://forum.serverless.com/u/frengkys)\
**Post date:** [October 10, 2016, 9:41am UTC](https://forum.serverless.com/t/serverless-api-gateway-function-error/484/1 "2016-10-10T09:41:37Z")

</div>

i wonder how to get value from data from send request for example

[//serverless.yml](https://serverless.yml)  
functions:  
hello:  
handler: handler.hello  
events:  
- http:  
path: "getTest/{damn}"  
method: get  
request:  
template:  
application/json: \>  
{  
“damn”: “$input.params(‘damn’)”  
}

[//handler.js](https://handler.js)  
module.exports.hello = (event, context, cb) =\> {  
cb(null, { Message: ‘you got me’+ event.damn});  
};

and when i test it, error like this:  
“errorMessage”: “Unexpected token .”,  
“errorType”: “SyntaxError”,

---

<div class="post-metadata">

**Author:** ![flomotlik](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/flomotlik/32/3_2.png) [@flomotlik](https://forum.serverless.com/u/flomotlik)\
**Post date:** [October 12, 2016, 2:49pm UTC](https://forum.serverless.com/t/serverless-api-gateway-function-error/484/2 "2016-10-12T14:49:49Z")

</div>

You can add a `console.log(event);` to your function handler to see exactly where your data is accessible.

---

<div class="post-metadata">

**Author:** ![frengkys](https://avatars.discourse-cdn.com/v4/letter/f/9fc348/32.png) [@frengkys](https://forum.serverless.com/u/frengkys)\
**Post date:** [October 13, 2016, 9:31am UTC](https://forum.serverless.com/t/serverless-api-gateway-function-error/484/3 "2016-10-13T09:31:01Z")

</div>

ahhhh, thanyou for replying …
