I was re-testing the original and the new code with Lambda, because I was getting an error with both sets of code:
Response
{
"statusCode": 500,
"body": "{\"error\":\"Unexpected token u in JSON at position 0\"}"
}
I came across the following, that will likely be relevant to the format the data should be sent in when everything is hooked up.
// // Create Lambda Test JSON using the body example below:
// // Note that the body is a stringified JSON, because API Gateway Lambdas expect event body in a stringified format.
// // {
// // "body": "{\"message\":\"Test Data to Encrypt 2023-02-12T18:45:03.608Z\",\"key\":\"586poj4dsii988\"}"
// // }
e.g., it didn't work setting up the test function with:
{
"message": "testing encryption 1 2 3",
"key": "a98dgahdff988709df"
}
but it did when I set up the test function with:
{
"body": "{\"message\":\"Test Data to Encrypt 2023-02-12T18:45:03.608Z\",\"key\":\"586poj4dsii988\"}"
}
7:03
I was re-testing the original and the new code with Lambda, because I was getting an error with both sets of code: Response { "statusCode": 500, "body": "{\"error\":\"Unexpected token u in JSON at position 0\"}" } I came across the following, that will likely be relevant to the format the data should be sent in when everything is hooked up. // // Create Lambda Test JSON using the body example below: // // Note that the body is a stringified JSON, because API Gateway Lambdas expect event body in a stringified format. // // { // // "body": "{\"message\":\"Test Data to Encrypt 2023-02-12T18:45:03.608Z\",\"key\":\"586poj4dsii988\"}" // // } e.g., it didn't work setting up the test function with: { "message": "testing encryption 1 2 3", "key": "a98dgahdff988709df" } but it did when I set up the test function with: { "body": "{\"message\":\"Test Data to Encrypt 2023-02-12T18:45:03.608Z\",\"key\":\"586poj4dsii988\"}" } 7:03