@events_service.post()<EOL>def post_events_service(request):
<EOL>json_data = request.json<EOL>log.info("<STR_LIT:\n>")<EOL>log.info("<STR_LIT>")<EOL>log.info(json_data)<EOL>log.info("<STR_LIT:\n>")<EOL>webhook_obj = Webhook(json_data)<EOL>room = api.rooms.get(webhook_obj.data.roomId)<EOL>message = api.messages.get(webhook_obj.data.id)<EOL>person = api.people.get(message.personId)<EOL>log.info("<STR_LIT>".format(room.title))<EOL>log.info("<STR_LIT>".format(person.displayName))<EOL>log.info("<STR_LIT>".format(message.text))<EOL>me = api.people.me()<EOL>if message.personId == me.id:<EOL><INDENT>return {'<STR_LIT>': '<STR_LIT:OK>'}<EOL><DEDENT>else:<EOL><INDENT>if "<STR_LIT>" in message.text:<EOL><INDENT>log.info("<STR_LIT>")<EOL>catfact = get_catfact()<EOL>log.info("<STR_LIT>".format(catfact))<EOL>api.messages.create(room.id, text=catfact)<EOL><DEDENT>return {'<STR_LIT>': '<STR_LIT:OK>'}<EOL><DEDENT>
Respond to inbound webhook JSON HTTP POST from Webex Teams.