Need help understanding how Botpress comunicates w...
# 🤝help
b
Hi, My bot is integrated in Teams at the moment, and I am trying to get the user's team informations such as their name and email. Here is my problem, I have a hook on messages received with
console.log(event.tags)
which is where I expect to see the user's informations. This is what I get (I changed the ids for privacy but the format are the same):
Copy code
message: { 'teams:id': 'f:8ea7c01e-e9ec-e444-5555-d3c82c572709' },
  conversation: { 'teams:id': 'a:2bpxBRZN3Ex3riQiyw7s-2v1rWhBFfUHMHcF0GA12PtBejP501CvqZRMhVF473SSck8tIfxxaSFSWtmEqcXVjxWkQue2AweUrIBq2Ctrwk34ZFUXV30GdNUMiYSkzkT_Z' },
  user: { 'teams:id': '29:1Ql8QosLVXslSMBIO8KARDeiqrZr1xVO_OnzS39cqh3_yEc1gWyiPg-doEq3x2Xa4tZ7ngaD05i5C69olEIxBEg' } }
I tried every requests under the sun with those IDs on Graph API, but the format is incorrect (actual Graph IDs are much shorter and not in this format either) Yet it does say
teams:id
and it is returned by Teams to Botpress. I am wondering if those are encrypted ? Anyways, does anybody have an idea on how to do that ? Also, it would be nice to know how Botpress and Teams are communicating, there must be the user's id exchanged at some point no ? Thanks in advance !
r
@bulky-dusk-45106 sorry not familiar with teams, but here's the full source code of Teams integration. hopefully this helps? https://github.com/botpress/botpress/tree/master/integrations/teams
This is where the user ID from teams is passed as a tag to the BP user https://github.com/botpress/botpress/blob/master/integrations/teams/src/handler.ts#L37C18-L37C18
You can also access them in
event.tags.user
from in the studio (probably
event.tags.user['teams:id']
)
b
Thanks ! I will check this right now
It's really weird, the user id returned is something like
Copy code
teams:id': '29:1Ql8QosLVXslSMBIO8KARDeiqrZr1xVO_OnzS39cqh8_yEc1gWyiPg-doEq3x9Xa4tZ7ngaD05i5C88olEIxBEg'
Which isn't a user id, or maybe it is but encrypted. I admit that the source code didn't help me much sadly.
s
The Id can be consumed by Bot Framework API. Check my post: https://discord.com/channels/1108396290624213082/1194851411003981914/1194851411003981914
9 Views