Getting req.body undefined. on the hello bot tutorial


#1

i am trying to get the message posted by the user either on a mention or a chat:bot:message. also on the context variable the userid is undefined as well.


#2

Hi, we’re looking into it.


#3

@xavier
About the missing body, it seems we forgot to include a common expressJs middleware on that app called body-parser. We just updated the app to fix that. If you pull the latest on the reference app you will be able to see the JSON responses in req.body .

About the userId being undefined - some callbacks don’t include that in the JWT token. The body of the message will contain a sender id req.body.message.sender.id that can be used to see who sent a message. The webhooks that do include the userId on the JWT token are UI events, like card button presses.


#4

yea that worked thanks a lot