LCINO | 2022-02-28 10:36:04 UTC | #1
Good Morning,
I am trying to create an integration-action in Genesys Cloud with the Java 8 Lambda function. I have successfully created the integration and action in Genesys Cloud, I can successfully invoke the function but the input (Map<String,String> event) is empty.
The same function implemented in Node.js (a modified version of https://help.mypurecloud.com/articles/example-aws-lambda-function-with-a-data-action/ works fine but for project’s costrain I need to use Java.
But when I tried to log in the AWS Log console the function’s input I see that the input is empty ( should be in EVENT field):
I tried the function both in the AWS test tab and using and http endpoint and the result is different, I see the input in the “Event” field in AWS console.
I’m using the code from AWS Lambda function handler in Java - AWS Lambda (amazon.com):
public class ReqHandler implements RequestHandler<Map<String,String>, Map<String, Object>>{ Gson gson = new GsonBuilder().setPrettyPrinting().create(); @Override public Map<String, Object> handleRequest(Map<String,String> event, Context context) { LambdaLogger logger = context.getLogger();
logger.log("ENVIRONMENT VARIABLES: " + gson.toJson(System.getenv())); logger.log("CONTEXT: " + gson.toJson(context)); // process event logger.log("EVENT: " + gson.toJson(event)); logger.log("EVENT TYPE: " + event.getClass().toString());
Map<String, Object> response = new HashMap<String, Object>(); response.put("statuscode", 200); response.put("body", "{ ... }"); //Deleted body
return response; } }
How can I access the input value in the Java Lambda function? I tried to upload some pictures but I can upload only one image per post, by the way I'm tring to access the input specified in contracts tab inside the action in Genesys cloud.
Thank you
Jason_Mathison | 2022-02-28 15:10:05 UTC | #2
There appears to be some sort of bug here. Please open up a case with customer support so that we can research and prioritize getting this fixed.
--Jason
system | 2022-03-31 15:11:03 UTC | #3
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 13726