DynamoDB / API Gateway Integration

Hi Flowsters!

In this video, you will learn how to create a DynamoDB database, create an API and use all this in your Voiceflow’s project.

The Mapping Templates:


For the POST method

Integration Request

{ 
"TableName": "users",
"Item": {
    "email": {
        "S": "$input.path('$.email')"
    },
    "name": {
        "S": "$input.path('$.name')"
        },
    "score": {
        "N": "$input.path('$.score')"
    }
}
}

For the GET method

Integration Request

{
    "TableName": "users",
    "KeyConditionExpression": "email = :val",
    "ExpressionAttributeValues": {
        ":val": {
            "S": "$input.params('email')"
        }
    }
}

Integration response

#set($inputRoot = $input.path('$'))
{
    "user": [
        #foreach($elem in $inputRoot.Items) {
            "email": "$elem.email.S",
            "name": "$elem.name.S",
            "score": $elem.score.N
        }#if($foreach.hasNext),#end
 #end
    ]
}