Last active
September 20, 2017 10:21
-
-
Save jagrament/50c0eb247b6fe12ddedd86c262420785 to your computer and use it in GitHub Desktop.
Minimum CGS Lambda sample for Expert Agent Developer Dashboard (https://developers.sebastien.ai)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
print('Loading function') | |
def respond(err, res=None): | |
return { | |
"headers":{"Content-Type": "application/json"}, | |
'statusCode': 200, | |
'body' : json.dumps(res) | |
} | |
def lambda_handler(event, context): | |
print("Received event: " + json.dumps(event, indent=2)) | |
payload = json.loads(event['body']) | |
return respond(None, {"error_code": "success", "status": "true", "user_id": payload["user_id"], "bot_id": payload["bot_id"], "params": {"status": "true", "message": "CGSからのメッセージです。"}}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment